Redirecting stdout stderr separately.

Rick Schubert rns at se-sd.sandiego.NCR.COM
Fri Apr 1 03:07:35 AEST 1988


In article <287 at unh.UUCP> abc at unh.UUCP (Avinash B Chopde) writes:
>
>Is there any simple way in C-Shell to duplicate the following
>Bourne Shell command to redirect stdout messages to file1 and
>stderr messages to  file 2 ?
>
>$ command 1> file1 2> file2

Try this:

% (command > file1) >& file2

This (I believe) causes an extra shell to be executed, so it is less
efficient than for the Bourne shell, but it should do what you want.



More information about the Comp.unix.questions mailing list