[lug] How does bash "set -e" work?
zlynx at acm.org
Thu Jan 3 01:51:01 MST 2013
On 1/2/2013 6:23 PM, Jeffrey S. Haemer wrote:
> Rob deduces from this that the " || " persuades the parent shell to
> instruct its subshell to ignore the flag, but that that instruction is
> not passed through the environment. In other words, there's got to be
> some other, out-of-band information channel to the child process.
The information channel is not very mysterious. A sub-shell is simply a
fork of the parent shell. There is no exec after the fork. The fork'd
shell gets a copy of all the variables of the parent. One of these is
probably a in_pipeline variable of some sort.
More information about the LUG