Aaron Maxwell personal blog
“Exit traps” can make your Bash scripts more robust and reliable (2013)
There is a simple, useful idiom to make your bash scripts more robust - ensuring they always perform necessary cleanup operations, even when something unexpected goes wrong. The secret sauce is a pseudo-signal provided by bash, called EXIT, that you can trap ; commands or functions trapped on it will execute when the…
- Points
- 591
- HN comments
- 186
- Submissions
- 2
- Cited by
- 0 commenters
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Jun 20, 2023 | “Exit traps” can make your Bash scripts more robust and reliable (2013) by ekiauhce | 591 | 148 |
| Jan 13, 2018 | How “Exit Traps” Can Make Bash Scripts More Robust and Reliable by striking | 158 | 38 |