Antonio Ospite wrote:
> When "set -e" is enabled traps are not always executed, in particular
> the EXIT trap is not executed when the shell exits on an unhandled
> error.
>
> Consider the following test script:
>
> #!/bin/dash
>
> set -e
>
> trap 'ret=$?; echo "EXIT: $ret"' EXIT
> trap
On Tue, 16 Oct 2018 14:09:52 +0200
Antonio Ospite wrote:
[...]
> I am marking the patch as RFC because I don't know the dash codebase very
> well, and I might not be aware of possible drawbacks of this change. It worked
> in my limited testing but that's it.
>
I forgot the '--rfc' option when
When "set -e" is enabled traps are not always executed, in particular
the EXIT trap is not executed when the shell exits on an unhandled
error.
Consider the following test script:
#!/bin/dash
set -e
trap 'ret=$?; echo "EXIT: $ret"' EXIT
trap 'exit 2' HUP INT QUIT PIPE TERM
read