title: practical examples use dup or dup2
body: <p>I know what <a href="http://www.opengroup.org/onlinepubs/009695399/functions/dup.html" rel="noreferrer"><code>dup</code> / <code>dup2</code></a> does, but I have no idea when it would be used.</p>
  
  <p>Any practical examples?</p>
  
  <p>Thanks.</p>