是否可以检查bash脚本中是否设置了-e?
如果外壳程序功能需要特定的-e / + e设置才能起作用,是否可以在本地设置该设置,然后在退出该功能之前将其恢复为以前的设置? myfunction() { # Query here if -e is set and remember in a variable? # Or push the settings to then pop at the end of the function? set +e dosomething doanotherthing # Restore -e/+e as appropriate, don't just do unconditional set -e }