Hi Eric,

* Eric Blake wrote on Wed, Nov 12, 2008 at 03:51:35AM CET:
> According to Ralf Wildenhues on 11/11/2008 12:35 PM:
> > I haven't found a shell that needs this subshell, but this:
> > $ echo '...' | ./foo 2>/dev/null
> > 
> > causes this output from some bash versions:
> > | bash: echo: write error: Broken pipe
> 
> But doesn't that only happen if ./foo exits prior to echo being able to
> push all its output?

Sure.  That was the case in the example you gave, though.
I haven't checked whether that test case matched the code
you are using in Autoconf.

> I guess if the shell can't handle the input, it will
> exit early, but maybe we could write this as:
> 
> echo '...' | { ./foo 2>/dev/null; as_status=$?; cat >/dev/null;
>  test $as_status = 0; }
> 
> so that there is something to consume all of the echo output?

I think you should be able to use
  echo '...' 2>/dev/null | ./foo 2>/dev/null

> But I don't think we have to worry about this unless we get actual
> reports of a noisy echo.

Well, tell me where in the code this construct is used, and I will
check whether it can be exposed.

Cheers,
Ralf


Reply via email to