title: How to redirect output away from /dev/null
body: <p>I have an application that runs the a command as below:</p>
  
  <p><code>&lt;command&gt; &lt;switches&gt; &gt;&amp; /dev/null</code></p>
  
  <p>I can configure <code>&lt;command&gt;</code>, but I have no control over <code>&lt;switches&gt;</code> . All the output generated by this command goes to <code>/dev/null</code>. I want the output to be visible on screen or redirected to a log file.</p>
  
  <p>I tried to use <code>freopen()</code> and related functions to reopen <code>/dev/null</code> to another file, but could not get it working. </p>
  
  <p>Do you have any other ideas? Is this possible at all?</p>
  
  <p>Thanks for your time.</p>
  
  <p>PS: I am working on Linux.</p>