0

Cygwin を使用して CURL コマンドを実行しています。

$ curl http://URL/update.json --connect-timeout 10000 --max-time 10000 --data-binary @bars.json -H 'Content-type:application/json;charset=utf-8;X-Vendor-Email=myemaiL@gmail.com;'
{"uploaded":true,"message":"Bars JSON received.  A email will be sent after processing has completed."}

ご覧のとおり、これは正常に機能し、リモート サーバーに正常にアップロードされます。これをスクリプトファイルに入れて、この公言を自動化しようとしています。

私のスクリプトファイル:

cd /cygdrive/x
curl http://URL/update.json --connect-timeout 10000 --max-time 10000 --data-binary @bars.json -H 'Content-type:application/json;charset=utf-8;X-Vendor-Email=EMAIL@gmail.com;

エラー:

$ /bin/test.sh
: No such file or directorycygdrive/x
/bin/test.sh: line 2: unexpected EOF while looking for matching `''
/bin/test.sh: line 3: syntax error: unexpected end of file
4

1 に答える 1

1

'コマンドの最後にクロージングを追加する必要があります。

curl http://URL/update.json --connect-timeout 10000 --max-time 10000 \
 --data-binary @bars.json \
 -H 'Content-type:application/json;charset=utf-8;X-Vendor-Email=EMAIL@gmail.com'
于 2013-04-11T19:19:31.707 に答える