title: Bash Sed Find & Replace With Special Characters
body: <p>I am trying to find <code>{AUTH-KEYS-SALTS}</code> in the file <code>wp-config.php</code> and replace it with the contents of the bash variable <code>keysalts</code>.</p>
  
  <pre><code>keysalts=`curl -sS https://api.wordpress.org/secret-key/1.1/salt/`
  sed -i "s/{AUTH-KEYS-SALTS}/$keysalts/g" wp-config.php
  </code></pre>
  
  <p>The following almost works, except that <code>keysalts</code> has a bunch of special characters such as $`;'" and sed is getting confused. Basically, how do I escape everything and just replace {AUTH-KEYS-SALTS} with $keysalts?</p>
  
  <p>Thanks.</p>