title: sed -i touching files that it doesn't change
body: <p>Someone on our server ran <code>sed -i 's/$var &gt;&gt; $var2/$var &gt; $var2/ *</code>  to change inserts to overwrites in some bash scripts in a common directory. No big deal, it was tested first with <code>grep</code> and it returned the expected results that only his files would be touched.</p>
  
  <p>He ran the script and now 1200 files of the 1400 in the folder have a new modified date, yet as far as we can tell, only his small handful of files were actually changed. </p>
  
  <ol>
  <li>Why would sed 'touch' a file that it's not changing.</li>
  <li>Why would it only 'touch' a portion of the files and not all of them.</li>
  <li>Did it actually change something (maybe some trailing white space or something totally unexpected because of the <code>$</code>'s in the sed regex)?</li>
  </ol>