title: Removing Carriage return on Mac OS X using sed
body: <p>On Linux for removing carriage return we can execute:</p>
  
  <pre><code>sed -i 's/\r//g' &lt;file&gt;
  </code></pre>
  
  <p>But the same will not work on Mac OS X. Need to prepend <code>$</code> like:</p>
  
  <pre><code>sed -i $'s/\r//' &lt;file&gt;
  </code></pre>
  
  <p>And "g" is also not needed.</p>
  
  <p>Why is this so?</p>