1

For example, does

set -o nounset -o pipefail -o errexit -o noglob -o posix

apply to subshells in bash4 for any sub-version? From what I've read online and in the bash reference, set -e, AKA set -o errexit may apply to certain subshells such as command substitutions. The problem is that the documentation is not super transparent, and it's harder to devise appropriate tests for bash than some other programming languages.

  • The behaviour of set -e varies from version to version and shell to shell and is generally unpredictable. I would stay clear of it and do proper error handling by hand. – Stéphane Chazelas Aug 11 '17 at 6:46
  • See also mywiki.wooledge.org/BashFAQ/105 – Stéphane Chazelas Aug 11 '17 at 6:54
  • Ah thanks a ton. I found a lot of users that recommended its use, but I've had nothing but frustrations with it lately. Glad to know I'm not the only one. – LumpyGrads Aug 11 '17 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.