title: Sed gives: sed: can't read : No such file or directory
body: <p>I have the following <code>bash</code> script which repeats for each image found. It needs to iterated over all <em>html</em>, <em>css</em> and <em>js</em> files, and replace all occurrences of an image within that file.</p>
  
  <pre><code> for image in app/www/images-theme-dark/*.png
      do
          echo "installing icon" $image
  
          # extract filename from iconpath
          iconfile=$(basename $image)
          iconPath="images/"$(basename $image)
  
          # replace paths in all files containing icon paths
          find app/www -type f \( -name "*.html" -or -name "*.css" -or -name "*.js" \
                              -or -name "*.appcache" \)  \
              -exec sed -i '' -e 's|$iconPath|images-theme-dark/$iconfile|g' "{}" \;
  
      done
  </code></pre>
  
  <p>However when I run the script <code>sed</code> gives:</p>
  
  <p><code>sed: can't read : No such file or directory</code></p>
  
  <p>On StackOverflow I've found <a href="https://stackoverflow.com/questions/22716187/sed-cant-read-no-such-file-or-directory">sed: can&#39;t read : No such file or directory</a> But I already had quotes around <code>{}</code></p>
  
  <p>When I echo the <code>sed</code> command and and execute it on the command line manually there is no error.</p>
  
  <p>I am using GNU sed v4.2.2 on Raspbian GNU/Linux 8.0 (jessie)</p>
  
  <p>Does someone see what could be wrong here?</p>