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

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 (loop)
		(P | (i | (p | (e > /dev/tty) >>& eerrors) \
		    >>& perrors) >>& ierrors) >>& Perrors
	end

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