我有一个 bash 脚本设置来执行一些 curl 请求
for currency in EUR INR JPY
do
curl -i --data '{"currency": "'$currency'"}' -H "Accept: application/json" -H "Content-Type: application/json" http://0.0.0.0:8080/price && echo
done
Run Code Online (Sandbox Code Playgroud)
如果其中一个 curl 响应以 http 状态 != 200 返回,有没有办法让脚本退出?
我还想保留标准的 curl 输出,例如我不想要一个只打印 http 状态代码的解决方案。
干杯
我试图忽略同步中的.git
,.bundle
和node_module
目录。我尝试了一堆不同的组合试图让它工作,但每次我同步时,我都能看到所有这些目录同步到远程机器。
谁能发现我做错了什么?
~/.unison/default.prf
# Roots of the synchronization
root = /Users/bob/synced
root = ssh://bob@remotebox/synced
# Paths to synchronize
path = hack/testdir
# Some regexps specifying names and paths to ignore
ignore = Name *.log
ignore = Name .DStore
ignore = Name .DS_Store
ignore = Name *.output
ignore = Name *:*
ignore = Path {*/.git/*}
ignore = Path {*/.bundle/*}
ignore = Path {*/.vagrant/*}
ignore = Path {*/.git}
ignore = Path {*/.bundle}
ignore = Path {*/node_modules} …
Run Code Online (Sandbox Code Playgroud) 我打算使用这样的命令
FOR /R %f in (".") DO xcopt test.txt %f
Run Code Online (Sandbox Code Playgroud)
将文件复制到文件夹的所有子目录中。
当我将文件写入命令提示符时,这工作正常,但当我将其放入批处理文件并运行批处理文件时,它不起作用。
关于为什么这不能从批处理文件运行的任何想法?
谢谢
bash ×1
batch ×1
command-line ×1
curl ×1
script ×1
shell ×1
shell-script ×1
sync ×1
unison ×1
windows ×1