▲ | bjackman 3 days ago | |||||||
But trap doesn't "stack" (like e.g. defer in Go) so if you do this it's not available for other purposes like cleanup | ||||||||
▲ | teddyh 3 days ago | parent | next [-] | |||||||
Yes. This also means that if you use a third-party shell library which uses “trap” internally (like shunit2), you can’t use “trap” in your own script at all. | ||||||||
▲ | gkfasdfasdf 3 days ago | parent | prev [-] | |||||||
not sure what you mean, you can have separate ERR and EXIT traps that run independently. | ||||||||
|