in reply to Re^3: capturing stderr of a command, invoked via backticks (2>&1)
in thread capturing stderr of a command, invoked via backticks

foo 2>&1 >file is useful but does something other than WYM (what you mean). Order matters. 2>&1 changes STDERR to go where STDOUT currently is and "redirectives" are processed from left to right. So foo 2>&1 >file | bar sends foo's STDOUT to file and foo's STDERR to bar's STDIN. What you want is foo >file 2>&1 which sends both STDOUT and STDERR to file (you have to dup STDERR to match STDOUT after you've redirected STDOUT to the file).

- tye