I have a script called foo that runs the program a.exe and sends the timing statistics to a file, time.log
#!/bin/bash
date 1>> time.log
(time ./a.exe) 2>> time.log
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)
foo &
exit
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?
thanks