I am using set -e
to stop execution of a script on first error.
The problem is that this does not tell me what went wrong.
How can update a bash scr
make err.sh
set -e
trap 'echo "ERROR: $BASH_SOURCE:$LINENO $BASH_COMMAND" >&2' ERR
include it (. err.sh
) in all your scripts.
replace any
... | while read X ; do ... ; done
with
while read X ; do ... ; done < <( ... )
in your scripts for the trap to give the correct line number/command in the error message