[Top][All Lists]

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

Re: Bash-5.1-beta available

From: Chet Ramey
Subject: Re: Bash-5.1-beta available
Date: Fri, 11 Sep 2020 10:03:43 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

On 9/11/20 6:39 AM, Andreas Schwab wrote:
> On Sep 10 2020, Chet Ramey wrote:
>> yy. Process substitution processes now get their input from /dev/null, since
>>     they are asynchronous, not interactive, and not jobs.
> That breaks scripts that want to filter stdin with a process
> substitution, eg:
> while read ...; do ...; done < <(filter)
> The reason for using a process substitution is so that the loop can set
> shell variables.

The problem is that asynchronous processes should not be able to change
the terminal or terminal settings, and you don't want the process
substitution and parent process to be trying to read from the terminal at
the same time. Job control and process groups usually take care of that,
but process substitution is not a job control process and runs in the same
process group (and terminal process group) as the parent.

Look at something like


Maybe it would be better to do this only if the shell is interactive and
the standard input is a terminal.

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

reply via email to

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