func() { eval "trap 'return 42' ERR; false" return 0 } set -o errtrace func || echo oops: $?