title: How to get lines between two patterns
body: <p>I have a file like this:</p>
  
  <blockquote>
    <p>a sth1<br>
    a sth2<br>
    b sth3<br>
    b sth4<br>
    c sth5<br>
    c sth6<br>
    c sth6<br>
    d sth8<br>
    d sth9<br>
    d sth10<br>
    X sth10<br>
    X sth11<br></p>
  </blockquote>
  
  <p>and I woul'd like to recive all lines between first line starting with <code>b</code> and last line starting with <code>d</code>:</p>
  
  <blockquote>
    <p>b sth3<br>
    b sth4<br>
    c sth5<br>
    c sth6<br>
    c sth6<br>
    d sth8<br>
    d sth9<br>
    d sth10<br></p>
  </blockquote>
  
  <p>I have a sed command <code>sed -n /"b"/,/"d"/p final.txt</code> but the output is:</p>
  
  <blockquote>
    <p>b sth3<br>
    b sth4<br>
    c sth5<br>
    c sth6<br>
    c sth6<br>
    d sth8<br></p>
  </blockquote>
  
  <p>My question is how to modify sed command to get expected result ?</p>
  
  <p><strong>Im sorry for beeing not precise. I should ask about this:</strong></p>
  
  <p>I have a file like this:</p>
  
  <blockquote>
    <p>127.0.0.1 - - [04/Jun/2014:11:21:01 +0200] STH1<br/>
    127.0.0.1 - - [04/Jun/2014:11:21:01 +0200] STH2<br/>
    127.0.0.1 - - [04/Jun/2014:11:21:01 +0200] STH3<br/>
    127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH4<br/>
    127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH5<br/>
    127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH6<br/>
    127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH7<br/>
    127.0.0.1 - - [04/Jun/2014:13:21:01 +0200] STH8<br/>
    127.0.0.1 - - [04/Jun/2014:13:21:01 +0200] STH9<br/>
    127.0.0.1 - - [04/Jun/2014:13:21:01 +0200] STH10<br/>
    127.0.0.1 - - [04/Jun/2014:14:21:01 +0200] STH11<br/>
    127.0.0.1 - - [04/Jun/2014:14:21:01 +0200] STH12<br/>
    127.0.0.1 - - [04/Jun/2014:15:21:01 +0200] STH13<br/>
    127.0.0.1 - - [04/Jun/2014:15:21:01 +0200] STH14<br/></p>
  </blockquote>
  
  <p>and I want extract content between first line containing <code>$startDate="04/Jun/2014:12:21:01"</code> and last line containing <code>$endDate="04/Jun/2014:13:21:01"</code>. The result should be:</p>
  
  <blockquote>
    <p>127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH4<br/>
    127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH5<br/>
    127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH6<br/>
    127.0.0.1 - - [04/Jun/2014:12:21:01 +0200] STH7<br/>
    127.0.0.1 - - [04/Jun/2014:13:21:01 +0200] STH8<br/>
    127.0.0.1 - - [04/Jun/2014:13:21:01 +0200] STH9<br/>
    127.0.0.1 - - [04/Jun/2014:13:21:01 +0200] STH10<br/></p>
  </blockquote>
  
  <p><code>$startDate</code> and <code>$endDate</code> are variables in BASH script. I really apologise for my last post where I asked not precise question...</p>