参考: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