I/O Redirection with the C Shell

Glenn Reid greid at adobe.UUCP
Tue Dec 3 07:54:54 AEST 1985


Here is a technique that will work.  The premise is that you *cannot*
redirect the two channels to two different places with the c-shell.
The solution is to use a subshell from the c-shell.

> example for sh(1):
>   nroff -ms document > doc 2> index


A hack that will work with csh(1):

  (nroff -ms document > doc) >& index

The parentheses create a subshell which will run nroff.  The
standard output from the nroff program will be redirected into the
file "doc".  Anything written to the standard error channel will
be visible the standard error channel of the subshell (in parens),
which can then be redirected into index.

Glenn Reid
..decwrl!adobe!greid
-- 
Skipping unavailable article...



More information about the Comp.unix mailing list