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

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

 

if [ $? != 0 ]; then

    echo "err"

    exit 0

fi

 

返回错误使用exit 1

 

参考:

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

猜你喜欢

转载自crabdave.iteye.com/blog/2358068