On Mon, 29 Jul 2002, 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.

There is nothing wrong your statement unless perl is not in the path 
and/or goup is not printing it's error strings to STDERR.

> 
> 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.

1 and 2 are the file descriptors for standard output and error respectively.
1>basicName.err means all messages that usually would get printed to the
standard output will now go to basicName.err. 2>&1 says that whatever is
written to standard error will go to the standard output, which in this 
case is to the file basicName.err. 

> 
> 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