On 9/30/21 7:24 PM, Mark March wrote:
If execfail is set, a failed exec does not cause a non-interactive shell to exit, but it seems to reset the EXIT trap:
Yes. When the shell runs `exec', it assumes the execed program will overlay the shell process. To make that happen transparently, it has to undo things it has done: it ends job control and restores the original process groups, it restores the signal dispositions that it got from its parent, and it clears other shell state like the EXIT trap. If the exec fails, it tries to restore some things as well as it can, but it doesn't try to restore any traps. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/