title: Insert a multiline string with arbitrary special characters to a template file in a shell script
body: <p>Something like:</p>
  
  <p><code>cat template.txt | ruby -e 'puts STDIN.read.sub("%placeholder%", IO.read("content.txt"))' &gt; output.txt</code></p>
  
  <p>Or:</p>
  
  <pre><code>ed template.txt &lt;&lt;EOF
  /%placeholder%/d
  .r content.txt
  w output.txt
  EOF
  </code></pre>
  
  <p>Any alternatives?</p>