This prints “a”, as you’d expect:
set -e
myfun() { printf a; false; printf b; }
myfun
printf c
...because the “set -e” terminates the whole script immediately after running the “false” command.But this script prints “a-b-True”, where some people (myself included) might have expected it to print “a-False”:
set -e
myfun() { printf a-; false; printf b-; }
if myfun; then
printf True
else
printf False
fi
The “set -e” is ignored completely. Putting another “set -e” inside the definition of myfun doesn’t make any difference.