title: Getting the line number of a shell script error
body: <p>When I run the script I get this error</p>
  
  <pre><code>awk: fatal: cannot open file `text.txt' for reading (No such file or directory)
  </code></pre>
  
  <p>The problem is the script is about 450 lines and it's really hard to find exactly where it's talking about</p>
  
  <p>It would be great if I could just get a line number like</p>
  
  <pre><code>awk: fatal: cannot open file `text.txt' for reading (No such file or directory) at line ***
  </code></pre>
  
  <p>Or if I set -x then just </p>
  
  <pre><code>awk: fatal: cannot open file `text.txt' for reading (No such file or directory)
  Terminated at line ***
  </code></pre>