An Nguyen wrote:
> However, maybe its OS X or something silly. But, trying to redirect
> stdout and stderr to a file (i.e. cmd 1>blah 2>bob) - Shouldn't the
> rush: error message appear in the stdout file "blah" and not to echoed
> to the terminal? This is the result i receive.
Mmm. correcting myself, the 'rush:' errors go to stderr, but the
"*** NO RESPONSE FROM" messages go to stdout.
> xxxx:~/curses adnguyen$ ./stats.pl 2>&1 1>blah
> xxxx:~/curses adnguyen$ ./stats.pl 2>&1 1>blah
> xxxx:~/curses adnguyen$ ./stats.pl 2>&1 1>blah
> rush: 'rush -laj': sendto(angel:696): No route to host
Switch the 2>&1 and 1> around; the order is important.
You should get correct behavior with:
./stats.pl 1>blah 2>&1
..where both stdout + stderr appear in 'blah'.
This is not just OSX, but all versions of unix regarding
the bourne shell. It can be shown with ls(1), which reports
errors to stderr:
tower:~ root# ls notfound
ls: notfound: No such file or directory
tower:~ root# ls notfound 2>&1 >/dev/null <-- 2>&1 first is ineffective
ls: notfound: No such file or directory <-- (error message still shown)
tower:~ root# ls notfound >/dev/null 2>&1 <-- 2>&1 last works normally
tower:~ root# <-- (error message not shown)
Hope that helps.
--
Greg Ercolano, erco@(email surpressed)
Seriss Corporation
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)
|