i am using debian. running my program with time command and want the result of time written to a file, doing as follows:
time ./myprog > out.asc
./myprog’s output is written to out.asc but not the time’s result.
is there any way to send the time’s output also to out.asc? thanx!
timealways writes to stderr. To save this with bash, use2>&1to write to the same place as stdout (you need the parentheses so you get the stderr of time and not just the stderr of myprog):You could also have the timing information go to a separate file: