title: unix command to get lines from in between first and last occurence of a word and write to a file
body: <p>I want a unix command to find the lines between first &amp; last occurence of a word</p>
  
  <p>For example:</p>
  
  <p>let's imagine we have 1000 lines. Tenth line contains word "stackoverflow", thirty fifth line also contains word "stackoverflow".</p>
  
  <p>I want to print lines between 10 and 35 and write it to a new file.</p>