in reply to Redirecting and using output from executed program
STDERR is file descriptor 2, STDOUT is descriptor 1. You can redirect it wherever you want:
# no redirection C:\>perl -e "warn 'foo'" foo at -e line 1. # redirect STDERR to FILE (often /dev/null :-) C:\>perl -e "warn 'foo'" 2> out C:\>type out foo at -e line 1. # redirect STDERR to STDOUT C:\>perl -e "warn 'foo'" 2>&1 foo at -e line 1. # redirect STDERR to STDOUT and STDOUT to FILE C:\>perl -e "warn 'foo';print 'bar'">out 2>&1 C:\>type out foo at -e line 1. bar
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Redirecting and using output from executed program
by Hena (Friar) on Sep 30, 2004 at 08:11 UTC | |
by tachyon (Chancellor) on Sep 30, 2004 at 08:13 UTC | |
by Hena (Friar) on Sep 30, 2004 at 08:22 UTC | |
by tachyon (Chancellor) on Sep 30, 2004 at 08:27 UTC | |
by Hena (Friar) on Sep 30, 2004 at 08:35 UTC |