title: unix: using sed to replace filepaths with special characters
body: <p>I am trying to automate some scripts and need to change the paths of files one of the scripts reads to do the automation.</p>
  
  <p>Because these paths have special characters, I am hitting a wall.
  I have tried escaping the special characters but obviously I am doing sth wrong...</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>newpath="/media/g1/Enzymes@Work/MARENOSTRUM/PATHWAYS/COP/test1_A/"
  sed -e "s/THISISTHEPATHTOTHEDIRECTORY/${newpath}/g" sampleTrajs.py
  </code></pre>
  
  <p>which gives me the expected error:</p>
  
  <blockquote>
    <p>sed: -e expression #1, char 34: unknown option to `s'</p>
  </blockquote>