1 Functions to deal with errors in bash.
3 bash-trace: print stack trace (best bash stack trace ever).
4 errcatch: on error, do stack trace ane exit
5 errallow: undo errcatch
6 errexit: exit and print stack trace
8 the err* functions depend on bash-trace.
11 For scripts which don't or hardly contains functions, this is usually sufficient:
13 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
16 Related: see my bash script template repo.
18 Patches, bugs, and any feedback is very welcome via email to
19 Ian Kelling <ian@iankelling.org>.