The bash documentation for set -e
says:
The shell does not exit if the command that fails is [...] part of any command executed in a &&
or ||
list except the command following the final &&
or ||
, [...]
The command list in question is false && true
. The failing command is false
, which is not the last command in the list, so the shell does not exit. The 0
you're seeing is the exit status of echo success
.