title: Scanning text file line by line and reading line with unix shell script
body: <p>I know there are a lot of different threads already like this, but nothing I can find seems to explain well enough exactly what I'm trying to do.</p>
  
  <p>Basically I want to have a shell script that just goes through a text file, line by line, and searches for the words "Error" or "Exception". Whenever it comes across those words it would record the line number so I can later shoot the text file off in an email with the problem lines.</p>
  
  <p>I've seen a lot of stuff that explains how to loop through a text file line by line, but I don't understand how I can run a regular expression on that line, because I'm not sure exactly how to use regular expressions with a shell script and also what variable each line is being stored in...</p>
  
  <p>If anybody can clarify these things for me I would really appreciate it.</p>