> Greg Wooledge <wool...@eeg.ccf.org> writes:
> 
> > On Thu, Mar 12, 2009 at 05:21:04PM +0100, Andreas Schwab wrote:
> >> Still does not fix this case:
> >> 
> >> $ echo >&2 |& wc -l
> >> 
> >> 0
> >
> > That looks like the correct output to me.  When setting up a pipeline
> > with redirections, the pipeline happens first.
> > 
> > The manual says your example should be equivalent to
> >
> >   echo >&2 2>&1 | wc -l
> 
> You are right, it works as documented.  Still it looks counterintuitive.

I wonder if I should modify it so the implicit 2>&1 happens first, right
after the pipe, so any user-specified redirections can override it.  That
doesn't seem that radical a change.  Opinions?  (I know what you think,
Andreas ;-) ).

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    c...@case.edu    http://tiswww.tis.case.edu/~chet/


Reply via email to