小编hey*_*eya的帖子

Bash while 循环在成功的 curl 请求后停止

我目前正在学习如何编写 bash 脚本。一旦我的 curl 请求收到 200 响应代码,如何停止 while 循环?

aws --endpoint-url http://s3.sample.com/ s3 cp hello.php s3://bucket/
while [ true ]
do
    curl http://sample.com/hello.php &> /dev/null
done
Run Code Online (Sandbox Code Playgroud)

scripting bash shell-script

8
推荐指数
1
解决办法
3万
查看次数

标签 统计

bash ×1

scripting ×1

shell-script ×1