I've run across some scripting like this recently:
( set -e ; do-stuff; do-more-stuff; ) || echo failed
This looks fine to me, but it does not work! The set -e does not apply, when you add the ||. Without that, it works fine:
$ ( set -e; false; echo passed; ); echo $?
1
However, if I add the ||, the set -e is ignored:
$ ( set -e; false; echo passed; ) || echo failed
passed
Using a real, separate shell works as expected:
$ sh -c 'set -e; false; echo passed;' || echo failed
failed
I've tried this in multiple different shells (bash, dash, ksh93) and all behave the same way, so it's not a bug. Can someone explain this?

||outside the subshell affects the behavior inside the subshell. – cjm Feb 21 at 5:38(set -e; echo 1; false; echo 2)with(set -e; echo 1; false; echo 2) || echo 3– Johan Feb 21 at 15:48