Bash Gotchas
This kind of shit is why sysadmins drink.
(( )) can return false
Iff the expression in (( blah )) evaluates to <0, the (( )) returns false, so your set -e script will fall on its arse.
pipes into read can return false for no reason
In some old versions of bash (e.g. RHEL6), piping commands into while read -r blah from the left will return false unchecked at the end of the stream, so set -e will make a mockery of you.
Use while read -r blah; do something; done < <(command>) instead.