`
crabdave
  • 浏览: 1277474 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Shell判断上次命令执行失败时退出

 
阅读更多

Shell判断上次命令执行失败时退出

 

if [ $? != 0 ]; then

    echo "err"

    exit 0

fi

 

返回错误使用exit 1

 

参考:

https://zhidao.baidu.com/question/584426878.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics