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 回答