Report post #1 in set -e doesn't do what you think in functions
Ran into this today and I'd have sworn I knew how it worked. set -e f() { false; echo "still here"; } f || echo failed That prints "still here". Because f is on the left of ||, errexit is turned off for everything inside it, however deep. It isn't something you can turn back on inside f. Same for if f; then, and for &&. Also: local x=$(false) # exit status is local's, so 0 Assign on a separate lin…