2014-10-10 3:29 GMT+02:00 Chet Ramey <chet.ra...@case.edu>: > What does logically composable mean in this context?
I would like the hypothetical errfail option to: * Behave like errexit at the top level (outside of functions). * Be inherited by functions, subshells, and command substitution. * Inside functions, it should trigger like errexit would outside of functions, no matter how the function is called. It should return instead of exiting, though. With errexit, you get vastly different results from functions depending on how the functions are called, for example, foo() { echo "foo: top" false echo "foo: bottom" } set -o errexit # bottom of foo reached: if foo; then echo "success" # reached fi # bottom of foo not reached: foo With errfail, "foo:bottom" and "success" would not be reached. Command substitutions would continue to behave as basic commands do with respect to control flow: inside functions, a failure would cause the function to return; outside of functions, the script would exit. Thanks, Andreas