[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: EXIT trap is not executed after an exec failure in a non-interactive
From: |
Greg Wooledge |
Subject: |
Re: EXIT trap is not executed after an exec failure in a non-interactive shell |
Date: |
Thu, 30 Sep 2021 19:50:38 -0400 |
> On Fri, Oct 1, 2021, 01:25 Mark March <march@systempad.org> 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:
It also appears to reset the EXIT trap in an interactive shell.
unicorn:~$ shopt -s execfail
unicorn:~$ trap 'echo exiting' EXIT
unicorn:~$ trap -p EXIT
trap -- 'echo exiting' EXIT
unicorn:~$ exec sdkfkjsdf
bash: exec: sdkfkjsdf: not found
unicorn:~$ trap -p EXIT
unicorn:~$