我有一个执行许多命令的shell脚本.如果任何命令以非零退出代码退出,如何使shell脚本退出?
bash shell
我们假设我有一个bash脚本,我称之为:
bash -c "some_command" do something with code of some_command here
是否有可能获得代码some_command?我不是some_command直接在运行脚本的shell中执行,因为我不想改变它的环境.
some_command
bash scripting exit-code
bash ×2
exit-code ×1
scripting ×1
shell ×1