> $(xxx) is a word expansion, not a command.  Bash will only pay attention to
> the exit status of command substitution in one case (x=$(foo)).  This
> command substitution doesn't contribute to any other command's exit status,
> especially `echo', and `set -e' doesn't cause the shell to pay attention
> to it.

Thanks Chet, it's clear now.

> Exiting in a subshell will never cause the parent shell to exit,
> regardless of depth.

This is not true in general.
set -e; (exit 1); echo "I don't exist"

>> I've tested this with set -e, set -E, an ERR trap,
> All of those are useless and should be avoided.

Ok, I'm not particularly interested in using them, I was just
reinforcing my point.

Best regards
--
Carlos

Reply via email to