title: shell script: search and replace over multiple lines
body: <p>I'm looking for a way to search and replace over multiple lines through a shell script. This is what I'm trying to do:</p>
  
  <pre><code>source:
  [stuff before]
  &lt;!--WIERD_SPECIAL_COMMENT_BEGIN--&gt;
    [stuff here, possibly multiple lines.
  &lt;!--WIERD_SPECIAL_COMMENT_END--&gt;
  [stuff after]    
  
  target:
  [stuff before]
  [new content]
  [stuff after]
  </code></pre>
  
  <p>In short, I want to delete the comments and everything between them and replace with some new content. Basically, I want to do a simple sed command over multiple lines, and if possible just using some basic *nix tools, no additional scripting language.</p>