Date: Thu, 11 Jun 2026 11:59:19 -0400
From: Chet Ramey <[email protected]>
Message-ID: <[email protected]>
| > It is clear the subshell itself is part of
| > an AND-OR list, but I find the argument that the commands within the
| > subshell context are themselves part of the AND-OR list hard to buy
| > into.
|
| Because a subshell environment is, in POSIX terms, created as "a duplicate
| of the shell environment."
Also, be aware that in the (or at least, most) shells that seem to perform
the other way than bash (and others) do, are not doing that because of the
subshell, but because of the '.' command.
While I suspect it is probably incorrect, the "-e does not apply here"
status isn't passed into the execution environment for the '.' command
in ash derived shells, being in a subshell, or not, has nothing whatever
to do with it, and changing that is non-trivial the way '.' is implemented
(-e still applies there, if set, the '.' command processing just doesn't
know that it should be ignored in this instance.) Note that the status
from the '.' command isn't the issue, that behaves as expected, it is any
failing commands inside the script processed by the '.' command.
Lastly, just don't use -e .... Anyone who really understands shell
programming will tell you to never touch the thing (and only if you
understand that, and why, will you ever discover the very rare cases
where it can safely be used).
kre