the outputs of a program can be to STDOUT or STDERR ( and also to files 
it opens internally )

On unix like systems
STDOUT is known by &1
STDERR by &2

The output of a program on STDOUT goes wherever 1 is directed to 
similarly for STDERR 2

If U want to redirect STDERR to STDOUT use 2>&1

eg. program >/dev/null 2>&1 will destroy all output of the program




Ning Luo wrote:
> 
> Hi Sir
> 
> I have a perl script using system function, like
>  system("perl goup  1>basicName.scan  2>basicName.err");
> 
> goup is another perl script, what I want to do is executing goup, then 
> print the results to the file basicName.scan, if it abort abnormally 
> print the error message to file basicName.err.Would you mind  give a 
> help how to do this.
> 
> I have an example about system call, like
> system ("perl goup 1>basicName.err 2>&1 ")
>  This is to print error message to file basicName.err, there is no 
> syntax error, but I am not sure the meaning of 1 and 2>&1.
> 
> Thanks in advance
> 
> sincere yours
> 
> Ning
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to