user1462199
user1462199

Reputation:

Bash Script To PowerShell

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.

Upvotes: 1

Views: 165

Answers (2)

madsny
madsny

Reputation: 111

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

Upvotes: 1

themel
themel

Reputation: 8895

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".

Upvotes: 1

Related Questions