Beware that you can only have one EXIT handler. I've used this in the past figuring it's analogous to Go's `defer`, but unfortunately not.
e.g this script:
#!/bin/bash
trap 'echo Handler 1' EXIT
trap 'echo Handler 2' EXIT
Will only call 'Handler 2' on exit.