So, I want to capture the standard error to the log file.
The post below was by pfiynn, from the http://www.unix.com forum:
If your shell is Bash or similar, this set of redirections will do the job
command 3>&1 1>&2 2>&3 | tee file
What does it mean?
The redirection operator n>&m, makes file descriptor n to be a copy of file descriptor m.
So, we are:
– Opening a new file descriptor, 3, that is a copy of file descriptor 1, the standard output;
– Making file descriptor 1 a copy of file descriptor 2, the standard error output;
– Making file descriptor 2 to be a copy of file descriptor 3 the “backup” of the standard outputin a short: we swapped the standard output and the standard error output.