title: How to redirect time command output under Mac OS X
body: <p>There are several posts discussing the redirection of time command output to a file. For example</p>
  
  <pre><code>(time my_program) 2&gt; out
  
  { time my_program ; } 2&gt; out
  </code></pre>
  
  <p>They worked under Linux but they did not work under my Mac OS X machine with Darwin Kernel Version 11.2.0.</p>
  
  <pre><code>(time my_program) 2&gt; out
  Badly placed ()'s.
  
  { time my_program ; } 2&gt; out
  {: Command not found.
  }: Command not found.
  
  time --version
  --version: Command not found.
  0.000u 0.000s 0:00.00 0.0%      0+0k 0+0io 0pf+0w
  
  /usr/bin/time --version
  /usr/bin/time: illegal option -- -
  usage: time [-lp] command.
  </code></pre>
  
  <p>Under my Mac machine, there are shell-built-in <code>time</code> and <code>/usr/bin/time</code>. Neither of them provides the -o option. Because my program runs for a few days, and I want to time it, how can I redirect the output of <code>time</code> to a file under Mac OS X?</p>