title: using sed with local variables that have /
body: <p>I'm trying to make the sed command replace these:</p>
  
  <pre><code>CURRENT_TOMCAT=/opt/tomcat/lib
  NEW_TOMCAT=/usr/tomcat/lib
  sed -i "s/$CURRENT_TOMCAT/$NEW_TOMCAT/" tomcat.env 
  </code></pre>
  
  <p>I've tried a bunch of combinations with no success, sometimes getting the unknown option to `s' error, sometimes getting no errors, but no changes are made</p>
  
  <p>The line I that needs to be change looks like this:</p>
  
  <pre><code>TOMCAT_LIB=/opt/tomcat/lib; export TOMCAT_LIB
  </code></pre>