set -e
f() {
echo foo
false
echo bar
}
f || echo baz
echo buzz
prints "foo", "bar", "buzz", and continues. Furthermore, all the
shells I have in easy reach agree on it.
This seems wrong - the exit status of the f is guarded, but the false
is not. But also, the fact that everybody agrees makes me think it's
probably the agreed result of the last round of POSIX wrangling over
the -e definition some years back.
Is this intended, and is there a way to get the user's intended
behavior of exit on unchecked failure back? (E.g. is there a different
set to get functions to return on unchecked failure that might cover
this?)