Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 --databinary 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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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

share|improve this answer
    
so basically the command says "scan the string for escape characters and print the formatted string then convert that printed string to binary" –  akh2103 Feb 17 at 20:55
    
@akh2103 - yes I believe that's how it works. –  slm Feb 17 at 20:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.