3 ms·
I can't think of any difference if you're trapping both with the same handler. Probably only if you want a separate handler for ERR vs EXIT.
by phaemon 6y ago
I can't think of any difference if you're trapping both with the same handler. Probably only if you want a separate handler for ERR vs EXIT.
- Liskni_si 6y agoI often set up a temporary directory at the beginning and then clean it up in an EXIT trap. Adding ERR and errtrace (-E) would remove the tmpdir or the first failure anywhere, no matter if it's a recoverable one. So I'm sticking with just set -eu and trap EXIT...