title: Shell: redirect stdout to /dev/null and stderr to stdout
body: <p>I saw this interesting question at a comment on <a href="http://www.cyberciti.biz/faq/how-to-redirect-output-and-errors-to-devnull/" rel="noreferrer">cyberciti.biz</a>.</p>
  
  <p>That I found I even can't find a flexible way to do this in one-line command with sh.</p>
  
  <p>As far my thought for the solution is:</p>
  
  <pre><code>tmp_file=`mktemp`
  (./script 2&gt;$tmp_file &gt;/dev/null; cat $tmp_file) | ./other-script
  rm tmp_file
  </code></pre>
  
  <p>But you see, this is not synchronous, and fatally, it's so ugly.</p>
  
  <p>Welcome to share you mind about this. :)</p>