title: Escape a string for a sed replace pattern
body: <p>In my bash script I have an external (received from user) string, which I should use in sed pattern.</p>
  
  <pre><code>REPLACE="&lt;funny characters here&gt;"
  sed "s/KEYWORD/$REPLACE/g"
  </code></pre>
  
  <p>How can I escape the <code>$REPLACE</code> string so it would be safely accepted by <code>sed</code> as a literal replacement?</p>
  
  <p><strong>NOTE:</strong> The <code>KEYWORD</code> is a dumb substring with no matches etc. It is not supplied by user.</p>