title: How to show line number when executing bash script
body: <p>I have a test script which has a lot of commands and will generate lots of output, I use <code>set -x</code> or <code>set -v</code> and <code>set -e</code>, 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 <code>set -x</code>?
  Or any method which can deal with my script line location problem would be a great help.
  Thanks.</p>