1

What does this mean in Bash ?

 INFO=$(curl_with_log -F "sub=upload" \ -F "filecontent=@$FILE;filename=$DESTFILE" \ -F "login=$USER" -F "password=$PASSWORD" "$UPLOAD_URL") || return

Im trying to do the exact same thing in powershell, i got it for the most part, i just need to know what this section is doing.

\ -F "filecontent=@$FILE;filename=$DESTFILE" \

I think there is something funky going on with the @$ but im not sure what its actually doing.

1
  • The backslashes are likely unnecessary. It looks like you took something that was split across multiple lines and joined it back into one line. Commented Sep 4, 2012 at 20:11

2 Answers 2

1

Nothing funky is going on, the @ is not interpreted by bash at all.

themel@kallisti: ~ $ FILE=foo
themel@kallisti: ~ $ echo @$FILE
@foo

This is most likely interpreted by curl, where @somewhere usually means "contents of file somehwere".

Sign up to request clarification or add additional context in comments.

Comments

1

For a full list of Curl options, check out this site: http://curl.haxx.se/docs/manpage.html

Under -F you'll find this:

You can also explicitly change the name field of a file upload part by setting filename=, like this:

curl -F "file=@localfile;filename=nameinpost" url.com

Comments