Bash exit traps

http://redsymbol.net/articles/bash-exit-traps/
https://news.ycombinator.com/item?id=36400465

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.