“Exit traps” can make your Bash scripts more robust and reliable (2013)
Fyi, related article...: "Minimal safe Bash script template" - <a href="https://news.ycombinator.com/item?id=25428621">https://news.ycombinator.com/item?id=25428621</a>