Remix.run Logo
gkfasdfasdf 3 days ago

not sure what you mean, you can have separate ERR and EXIT traps that run independently.

bjackman 3 days ago | parent [-]

Yeah but each only exists once. If you wanna clean up on ERR and also use that trap for debugging you need to implement some janky layer on top of the trap.

(FWIW my take away from issues like this is always: Bash is not a serious programming language. If you are running up against these limitations in real life it's time to switch language. The challenge is really in predicting when this will happen _before_ you write the big script!)