shell脚本中执行curl遇到异常继续执行

正常执行:curl -o /dev/null -s -w %{http_code} $url时,遇到异常返回000,脚本退出;
如果需要继续执行脚本,修改为:curl -o /dev/null -s -w %{http_code} $url||true

posted @ 2021-11-16 16:07  没有猫的猫奴  阅读(793)  评论(0)    收藏  举报