Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!yale!cmcl2!acf8!berke
From: berke@acf8.UUCP (Wayne Berke)
Newsgroups: comp.unix.questions
Subject: Re: Redirecting stderr in csh
Message-ID: <1650003@acf8.UUCP>
Date: Tue, 1-Dec-87 12:50:00 EST
Article-I.D.: acf8.1650003
Posted: Tue Dec  1 12:50:00 1987
Date-Received: Fri, 4-Dec-87 20:46:35 EST
References: <1254@saturn.ucsc.edu>
Organization: New York University
Lines: 23

Chris Torek writes:
>In article <209@unicom.UUCP> dv@unicom.UUCP (David W. Vezie) writes:
>>You can use the "subshell" feature of csh, and do:
>>(cmd > /dev/tty) >& filename
>
>This *sometimes* does what is desired.  But there is no way to do
>in csh the following (without using temp files, which might overflow):
>
>	>Perrors; >ierrors; >perrors; >eerrors
>	while loop; do
>		P 2>>Perrors | i 2>>ierrors | p 2>>perrors | e 2>>eerrors
>	done | filter

Never say never.  What about:

#!/bin/csh
touch Perrors; touch ierrors; touch perrors; touch eerrors
while (1)
    (P | (i | (p | (e > /dev/tty) >& eerrors) >& perrors) >& ierrors) >& Perrors
end

Yes, I know its ugly.  Also doesn't address how to pipe fit the output
of a while loop, but that's a different issue.