[lug] How does bash "set -e" work?

Rob Nagler nagler at bivio.biz
Wed Jan 2 15:35:23 MST 2013

> My thinking is that for the example in the thread, all that is happening
> is that the compound forms have a true return status. No need for side-channel
> communication between the the parent and child shells (set, env and sort
> returned true -- so -e doesn't matter).

I don't think so:

% (set -e; false) && echo true
% (set -e; false; echo false; exit 1) && echo true
% (set -e; false; echo false) && echo true


More information about the LUG mailing list