3 ms·
For when things go wrong in your bash script, I really like the following: # Enable verbose logging of the bash script PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0
by graton 6y ago
For when things go wrong in your bash script, I really like the following:
# Enable verbose logging of the bash script
PS4='+ ${BASH_SOURCE:-}:${FUNCNAME[0]:-}:L${LINENO:-}: '
set -x
This improves the tracing function greatly (at the cost of much higher verbosity) in that you get the filename, function, and line number in the output.