Correct behavior of EXIT and ERR traps when using `set -eu`
I’m observing some weird behavior when using set -e (errexit), set -u (nounset) along with ERR and EXIT traps. They seem related, so putting them into one question seems reasonable. 1) set -u does not trigger ERR traps Code: #!/bin/bash trap ‘echo “ERR (rc: $?)”‘ ERR set -u echo ${UNSET_VAR} Expected: ERR trap gets called, … Read more