shell - curl call with parameters into variable doesn't work -


i'm working installr api. i'm trying following curl request via script :

curl -h "x-installrapptoken: mytoken"  https://www.installrapp.com/apps.json/ \   -f 'qqfile=@'$apkpath \   -f 'releasenotes=these release notes' \   -f 'notify=true' 

and works perfectly. however, when try release notes file variable :

releasenotes=`cat "release_notes/test.md"` curl -h "x-installrapptoken: mytoken"  https://www.installrapp.com/apps.json/ \   -f 'qqfile=@'$apkpath \   -f 'releasenotes='$releasenotes \   -f 'notify=true' > /dev/null 

it doesn't work @ all, first word sent. others, have error not resolve host: xxx.

i did echo on these 2 curl request , exact same thing printed. catcommand return specific format ?

probably issue quotes , spaces. can use double-quotes around variable allow variable expansion in shell.

releasenotes=$(cat "release_notes/test.md") curl -h "x-installrapptoken: mytoken"  https://www.installrapp.com/apps.json/ \   -f "qqfile=@${apkpath}" \   -f "releasenotes=${releasenotes}" \   -f 'notify=true' > /dev/null 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -