title: Redirecting stdout & stderr from background process
body: <p>I have a script called foo that runs the program a.exe and sends the timing statistics to a file, time.log</p>
  
  <pre><code>#!/bin/bash
  date 1&gt;&gt; time.log
  (time ./a.exe) 2&gt;&gt; time.log
  </code></pre>
  
  <p>This works if I run the script in the background of my terminal and keep my shell open until a.exe finishes, but if I run the script in the background and exit my terminal (a.exe takes a long time to run)</p>
  
  <pre><code>foo &amp; 
  exit
  </code></pre>
  
  <p>when I come back, a.exe has executed but the time statistics do not appear in my log file.  Does anyone know why this is?  Is there a way to get the timing statistics after I've closed the parent shell? </p>
  
  <p>thanks</p>