title: Unexpected substitution for & with sed
body: <p>I have a CSV file containing some special characters and their HTML entity names</p>
  
  <p>ex: <code>htm.csv</code></p>
  
  <pre><code>À,&amp;Agrave;
  Á,&amp;Aacute;
  Â,&amp;Acirc;
  Ã,&amp;Atilde;
  É,&amp;Eacute;
  Ê,&amp;Ecirc;
  Í,&amp;Iacute;
  Ó,&amp;Oacute;
  Ô,&amp;Ocirc;
  Õ,&amp;Otilde;
  </code></pre>
  
  <p>and I have a number of <code>.php</code> files where these special characters are present. I have written a shell script</p>
  
  <pre><code>#!/bin/bash
  IFS=","
  while read orig html
  do
     for fl in *.php; do
     mv $fl $fl.old
     sed 's/'$orig'/'$html'/g' $fl.old &gt; $fl
     done
  done&lt; "htm.csv"
  </code></pre>
  
  <p>but the problem is when using the contents of <code>$html</code>, it is printing the contents of <code>$orig</code> instead of <code>"&amp;"</code>.</p>