Understanding two flags and a dollar sign in a CURL command

command linecurl

I right-clicked a POST request in Chrome and selected "Copy as cURL".

I got a curl command that includes the following:

--data-binary $'------WebKitFormBound

I am used to seeing curl requests that have a single flag and string. Like this:

$ curl -0 "output.txt"

I understand that the --data-binary command will POST binary data (presumably after converting the string, after the --data-binary switch, into binary). But what does the dollar sign mean?

What does the curl request mean if it has two dashes and a dollar sign?

Best Answer

The notation being used there $'...' is a special form of quoting a string recognised by a few shells like ksh (where it originated), zsh and bash.

excerpt

Strings that are scanned for ANSI C like escape sequences. The Syntax is $'string'

Example

$ echo $'hola\n'
hola

$

References

Related Question