On 12/3/12 10:50 AM, Robert Schiele wrote: > On Mon, Dec 3, 2012 at 4:25 PM, Chet Ramey <chet.ra...@case.edu> wrote: >> Since the `source' command is called in a context where all commands within >> it should have the `errexit' flag disabled, bash chooses to satisfy this >> requirement by turning off the flag that (internally) represents errexit. >> Under most circumstances, however, that state is externally visible as the >> value of the -e option. >> >> Note that the behavior of suppressing the effect of the errexit option is >> correct. The value of the -e option in $- should be unaffected, though. > > Ah, now I start to understand how this is supposed to work. I also > realized that it is not possible within the function to turn on the > flag again with another internal set -e. Is that also part of the > design, meaning there is no way to have an effective set -e within a > function in case it was called in that context?
Correct. When called in a context where errexit is ignored, attempts to turn errexit on are ineffective. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/