title: Redirecting output in bash
body: <p>Here's what I am trying to do:</p>
  
  <p><code>time sh -c "dd if=/dev/zero of=ddfile bs=512 count=125 &amp;&amp; sync"</code></p>
  
  <p>When run that on shell the o/p is</p>
  
  <pre><code>125+0 records in
  125+0 records out
  64000 bytes (62.5KB) copied, 0.028935 seconds, 2.1MB/s
  real 0m 0.08s
  user 0m 0.00s
  sys 0m 0.01s
  </code></pre>
  
  <p>I want to capture the output to a variable or to a file. How do I do that ?</p>
  
  <p>Thanks!</p>