title: SED - Replace text between placeholders
body: <p>I need a few of you SED wizards to give a noob a hand....</p>
  
  <p>I'm using SED to replace text between some placeholders. 
  The problem is that they are on separate lines (and SED hates that apparently).</p>
  
  <p>The text I need to replace is between '#SO' and '#EO', like this: </p>
  
  <pre><code>#SO
  I need to replace this text
  #EO
  </code></pre>
  
  <p>I have come up with this:</p>
  
  <pre><code>sed -ni '1h; 1!H; ${ g; s/#SO\(.*\)#EO Test/1/REPLACEMENT/ p }' foo.txt
  </code></pre>
  
  <p>I'm just starting to get to grips with SED, so I could be totally wrong, but any advice would be great.</p>