On 1/12/16 7:20 PM, Martin Kealey wrote:
> 
> 
> On Mon, 11 Jan 2016, Chet Ramey wrote:
>> "The standard input for an asynchronous list, before any explicit
>> redirections are performed, shall be considered to be assigned to a file
>> that has the same properties as /dev/null."
> 
> I thought the (only) point of that to avoid a background job reading the tty
> in an environment that lacked job control.

That's the effect now, yes.  The original Bourne shell, since it didn't
have job control, made no distinction, and the standard doesn't either.

> The standard is actually a bit vague; under "Compound Commands" it mentions
> that "Each redirection will apply to all the commands within the compound
> command that do not explicitly override that redirection" but it fails to
> mention that this applies to pipes as well; so I submit that it is a
> reasonable interpretation that a pipe on an outer block counts as an
> (explicit) redirection for the purpose of reading the "Asynchronous Lists"
> sub section.

Agreed, and, as I said, the existing code attempts to do that.  The problem
is propagating the input pipe status into commands executed as part of a
compound command like a () subshell.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to