a.out 1> file.out 2> file.err in csh?

Joe Beckenbach joe at cit-vax.Caltech.Edu
Fri Oct 28 02:39:52 AEST 1988


In his article kmont at hpindda.HP.COM (Kevin Montgomery) writes:
>>Hate to be this cluelessly stupid, but something's been bugging the
>>hell out of me- how do you do the Bourne :
>>
>>	a.out 1> file.stdout 2> file.stderr
>>
>>in the csh?  ("a.out > file.stdout >& file.stderr" doesn't cut it,
>>since ">&" is defined to be BOTH stdout and stderr, hence is an
>>ambiguous redirection)

In his article dempsey at handel.colostate.edu..UUCP (Steve Dempsey) writes:
>This is far from obvious, so no need to feel cluelessly stupid:
>
>     ( a.out > file.stdout ) >& file.stderr

	I tried the most natural thing in the world: following the 'law of
least astonishment'. I did
	a.out >&file.stderr >file.stdout
and of course the rest is ambiguity. :-)

	Do any shells out there (besides sh) handle redirecting stderr
INDEPENDENT of stdout? I think that csh was very naughty in mixing the
streams-- do we have to try writing a public-domain shell in order to have
a well-distributed sane shell? [ gsh! ;-) :-) have you beat me to the punch,
FSF?]
-- 
Joe Beckenbach	joe at csvax.caltech.edu	Caltech 256-80, Pasadena CA 91125
	... or have I not seen enough code yet to throw stones? 1/2 :-)



More information about the Comp.unix.wizards mailing list