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
In reply to Re^4: capturing stderr of a command, invoked via backticks (order)
by tye
in thread capturing stderr of a command, invoked via backticks
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |