4 ms·
You don't need to copy those boilerplate functions everywhere you go. Bash and others have "set -e" which will make the overall script exit with an error if on
by jzwinck 12y ago
You don't need to copy those boilerplate functions everywhere you go. Bash and others have "set -e" which will make the overall script exit with an error if one of its commands returns an error. Also useful is "set -u" to detect the use of unset variables (though some people write shell scripts which depend on those, so it's not as universally applicable).
Try writing "set -eu" as the first line of your shell scripts. It's sort of like compiling with "-Wall -Werror"--not the default but perhaps should have been.