title: sed and grep get the line number for a match
body: <p>I have a log file and i use sed to extract the lines between two strings which contains the word MATCH. I use sed to extract the lines and grep to only take the lines containing the word "MATCH". I would need the lines number in the log file where a match is found.</p>
  
  <pre><code>Date:...
  TST STARTS
  DISCARD str1
  DISCARD str2
  MATCH str3 //line 5
  MATCH str4 //line 6
  DISCARD str5
  TST FINISHED
  </code></pre>
  
  <p>I use this command to extract the lines:</p>
  
  <pre><code>sed -n "/TST STARTS/,/TST FINISHED/p" log.txt | grep "MATCHED".
  </code></pre>
  
  <p>My output is:</p>
  
  <pre><code>MATCH str3
  MATCH str4
  </code></pre>
  
  <p>But I also need in the output the lines number:</p>
  
  <pre><code>line 5: MATCH str3
  line 6: MATCH str4
  </code></pre>