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 https://lists.gnu.org/archive/html/bug-bash/2019-09/msg00061.html 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 c...@case.edu http://tiswww.cwru.edu/~chet/