[Top][All Lists]

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

Re: implicit redirection of background within pipeline

From: Chet Ramey
Subject: Re: implicit redirection of background within pipeline
Date: Wed, 13 Jan 2016 09:22:05 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

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    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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