[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fewer forks during shell detection

From: Ralf Wildenhues
Subject: Re: fewer forks during shell detection
Date: Tue, 11 Nov 2008 20:35:56 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Eric,

somewhat older mail:

* Eric Blake wrote on Wed, Oct 29, 2008 at 04:53:54AM CET:
> I'm applying the following patch, which reduces the number of forks needed
> during the better shell search portion of M4sh scripts.
> Meanwhile, are there any shells where a message escapes when attempting to
> redirect stderr of a program that can't be executed?  More to the point,
> is this silent:
> echo 'echo hi' > foo
> chmod a-x foo
> echo '...' | ./foo 2>/dev/null
> or must we use (./foo) in order to squelch messages from some shell in the
>  case where ./foo is not executable or not a valid binary image?  I'm
> asking because _AS_RUN is currently using the subshell, after already
> verifying that 'test -f shell' passes (but doesn't do 'test -x shell'),
> and I'd like to remove the subshell if it is safe.

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

Of course that output isn't avoided by putting ./foo in a subshell,
and I think it doesn't affect the changed code, either, but I thought
I'd mention it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]