Skip to content

Commit

Permalink
FAQ: Clarify Windows double quote usage
Browse files Browse the repository at this point in the history
- Windows command prompt doesn't use literal quoting via single quotes.

- Windows command prompt inner double quotes are escaped with a
  backslash.

- Windows powershell does use single quotes but curl is not a powershell
  script so the arguments may not be passed on correctly.

- Windows powershell inner double quotes seems can be passed to curl if
  the outer quotes are double quotes and an escape of backslash-backtick
  is used.

Command prompt example:

~~~
getargs -v -d "\"a\""

argv[0]: getargs
argv[1]: -v
argv[2]: -d
argv[3]: "a"
~~~

Ref: #8818
Ref: https://gist.github.com/jay/19aba48653bd591cf4b90eb9249a302c

Reported-by: KotlinIsland@users.noreply.github.com

Closes #8823
  • Loading branch information
jay committed May 14, 2022
1 parent d56270c commit a61eac6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,14 @@ FAQ
Exactly what kind of quotes and how to do this is entirely up to the shell
or command line interpreter that you are using. For most unix shells, you
can more or less pick either single (') or double (") quotes. For
Windows/DOS prompts I believe you are forced to use double (") quotes.
Windows/DOS command prompts you must use double (") quotes, and if the
option string contains inner double quotes you can escape them with a
backslash.

For Windows powershell the arguments are not always passed on as expected
because curl is not a powershell script. You may or may not be able to use
single quotes. To escape inner double quotes seems to require a
backslash-backtick escape sequence and the outer quotes as double quotes.

Please study the documentation for your particular environment. Examples in
the curl docs will use a mix of both of these as shown above. You must
Expand Down

0 comments on commit a61eac6

Please sign in to comment.