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.
[ Parent
| on HN ]
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."