help-bash
[Top][All Lists]
Advanced

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

Re: bash read error


From: Chet Ramey
Subject: Re: bash read error
Date: Fri, 3 Jun 2022 10:26:16 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0

On 6/1/22 10:11 AM, Pascal wrote:
thank you Greg for these explanations and for these last three lines are
perfect for me.

reading fails in the background process ("simply") because the keyboard is
monopolized (attached/reserved) by the foreground process ?

More or less. When job control is active, each job (background process) is
in its own process group. The calling shell and terminal each have their
own process groups. You can only read from the terminal if your process
group is equal to the terminal's process group (this is what makes a
foreground process). A process substitution has its own process group,
which is different from the calling shell's and the terminal's, so it can't
read from the 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]