title: grep line containing a pattern to line containing other pattern
body: <p>Say the input is:</p>
  
  <pre><code>"&gt;"1aaa         
   2           
   3    
   4   
  "&gt;"5bbb   
   6    
   7   
  "&gt;"8ccc   
   9  
  "&gt;"10ddd   
   11   
   12  
  </code></pre>
  
  <p>I want this output (per example for the matching pattern "bbb"):</p>
  
  <pre><code>"&gt;"5bbb   
   6  
   7
  </code></pre>
  
  <p>I had tried with grep: </p>
  
  <pre><code>grep -A 2 -B 0 "bbb" file.txt &gt; results.txt
  </code></pre>
  
  <p>This works. However, the number of lines between <code>"&gt;"5bbb</code> and <code>"&gt;"8ccc</code> are variable. Does anyone knows how to achieve that using Unix command line tools?</p>