shell脚本set -x -e -eo pipefail -o errexit等等作用

参考:https://www.ruanyifeng.com/blog/2017/11/bash-set.html

因为shell脚本只有结果,所以可以用-x
set -x用来在运行结果之前,先输出执行的那一行命令。

-e还有另一种写法-o errexit。

全部使用写法一

set -euxo pipefail

写法二

set -eux
set -o pipefail

猜你喜欢

转载自blog.csdn.net/weixin_40557160/article/details/129801947