Add logging when bash script exits due to "set -e"
Often, a command that fails will not print an error message.
Under set -e, any failed command will cause the entire script to stop unless something like "| xargs" or "|| true" is added to the command.
And when viewing a pipeline, it isn't always obvious that a script has exited due to "set -e"
To do:
-
Set a trap in bash scripts running -e to print the line number and an error message before exiting
Edited by Brendon Lloyd