[comp.unix.questions] separate redirection of stderr and stdout in csh.

dg@lakart.UUCP (David Goodenough) (11/21/89)

karish@forel.stanford.edu (Chuck Karish) sez:
> In article <MONTNARO.89Nov17073713@sprite.crd.ge.com>
> <montanaro@crdgw1.ge.com> (Skip Montanaro) wrote:
>>How about 
>>
>>	(dumb_command > good_stuff) >& errors
> 
> This forks a subshell.  It's a Bourne shell, as written here.
> The `errors' file gets the stderr of the Bourne shell, not of
> the `dumb_command' process.
> 
> The real answer to the question is "You can't do it in csh".

I don't know whose csh you're using, but look at this:

Script started on Mon Nov 20 15:34:11 1989
lakart!dg(~)[61]-> ( sleep 200; cat /etc/passwd >/dev/null) &
[1] 3639
lakart!dg(~)[62]-> ps agtp0
  PID TT STAT  TIME COMMAND
 3623 p0 S     0:01 -h -i (/bin/csh)
 3639 p0 S     0:00 -h -i (/bin/csh)
 3640 p0 S     0:00 sleep 200
 3644 p0 R     0:00 ps ag
lakart!dg(~)[63]-> ^D
script done on Mon Nov 20 15:34:24 1989

Now, by my estimation, the subshell was pid 3639, and as ps shows 3639 is
a /bin/csh.
-- 
	dg@lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp@xait.xerox.com			  +---+