News for hackers. Stuff that matters.
Re:“Exit Traps” Can Make Your Bash Scripts Way More Robust a... by chasil on Tuesday June 20, 2023 @11:05PM (#36413887)
I found my original submission to the email list.

https://www.spinics.net/lists/dash/msg02208.html

"Signal terminations are not caught by EXIT. It only catches normal exits. Unfortunately, the EXIT condition is not well-defined by POSIX, so it's left to interpretation."

...

POSIX is making it unspecified what happens here:

https://austingroupbugs.net/view.php?id=621

The EXIT condition shall occur when the shell terminates normally (exits), and may occur when the shell terminates abnormally as a result of delivery of a signal (other than SIGKILL) whose trap action is the default.

Re:“Exit Traps” Can Make Your Bash Scripts Way More Robust a... by usr1106 on Wednesday June 21, 2023 @10:29AM (#36418906)
Why do people write such standards? May occur. I don't need a standard to do something random.
Re:“Exit Traps” Can Make Your Bash Scripts Way More Robust a... by usr1106 on Wednesday June 21, 2023 @10:31AM (#36418934)
I guess to get a well-defined behavior the interrupt handler needs to clear the EXIT trap.
Re:“Exit Traps” Can Make Your Bash Scripts Way More Robust a... by rigelina on Wednesday June 21, 2023 @11:57AM (#36420218)
In this type of scenario, it's sometimes because there are two or more implementors that are trying to develop the standard in a way that makes their existing implementation compliant. Likely there were existing scripts that relied on the behavior being specific to that implementation, so it was explicitly made optional, which is viewed as better than not adding the behavior to the standard at all. "May" is just a polite standards way of saying "Warning: check yourself before you wreck yourself."