Bash脚本问题

时间:2018-08-17 10:44:39

标签: bash

这是我使用Nexus Repository Manager API的bash文件脚本:

# Send Setup script
curl -u admin:admin123 -X POST --header 'Content-Type: application/json' \
http://localhost:8081/service/rest/v1/script \
-d @setup.json

# Test scripts
printf "---------------------- SCRIPTS ----------------------"
curl -u admin:admin123 -X GET http://localhost:8081/service/rest/v1/script

# Run script
curl -u admin:admin123 -X POST --header 'Content-Type: text/plain' \
 http://localhost:8081/service/rest/v1/script/setup/run

当我运行它时,输入为:

curl: (3) Illegal characters found in URL
./setup.sh: line 3: http://localhost:8081/service/rest/v1/script: No such file or directory
./setup.sh: line 4: -d: command not found
./setup.sh: line 5: $'\r': command not found
./setup.sh: line 7: printf: --: invalid option
printf: usage: printf [-v var] format [arguments]
curl: (3) Illegal characters found in URL
./setup.sh: line 9: $'\r': command not found
curl: (3) Illegal characters found in URL
: No such file or directory/localhost:8081/service/rest/v1/script/setup/run
./setup.sh: line 13: $'\r': command not found

问题出在哪里?反斜杠有问题吗?

0 个答案:

没有答案