I have a test script which has a lot of commands and will generate lots of output, I use set -x
or set -v
and set -e
, so the script would stop when error occurs. However, it's still rather difficult for me to locate which line did the execution stop in order to locate the problem.
Is there a method which can output the line number of the script before each line is executed?
Or output the line number before the command exhibition generated by set -x
?
Or any method which can deal with my script line location problem would be a great help.
Thanks.