Redirecting stdout stderr separately.

Sue LoVerso sue at encore.UUCP
Fri Apr 1 01:47:28 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
>
The simplest way I know of is:

% (command > file1) >& file2

Execute the command in a subshell, redirecting its output to file1,
and then its stderr output can be redirected at shell level to file2.

-- 
Susan J. LoVerso		Encore Computer Corp.
sue at multimax.arpa		
encore!sue



More information about the Comp.unix.questions mailing list