On 10/8/22 6:03 AM, Cynthia Coan wrote:
Otherwise, I think we can perhaps reword this into two smaller
features: "function local trap signals", and
I don't think this would be a feature worth the time to implement and
the complexity it would introduce. Is there any other use case for this
than cleaning up temporary files on function return?
"options to safely append/prepend to a trap" (for some definition of
'safe', perhaps this just means separating by ';'? Unsure if there's a
better way off the top of my head).
This can be achieved by adding a new option to `trap' that causes it to
print the action string for given condition. Let this option be named
`-P', the user would do something like this to update a trap:
trap "foo;" EXIT
trap "$(trap -P EXIT)bar;" EXIT