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
In reply to Re: Redirecting and using output from executed program
by tachyon
in thread Redirecting and using output from executed program
by Hena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |