[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (read -r var) vs <(read -r var) behavior
From: |
Chet Ramey |
Subject: |
Re: (read -r var) vs <(read -r var) behavior |
Date: |
Tue, 19 May 2015 21:17:22 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 5/19/15 4:23 AM, Marcelo Azevedo wrote:
> what do you mean here by 'owns' the terminal ? and that in the second
> (subshell) example none of these things is true.
> in '(command)' is command attached to the terminal and in '<(command)'
> command is not?
This is from the JOB CONTROL section of the man page:
"To facilitate the implementation of the user interface to job control,
the operating system maintains the notion of a current terminal process
group ID. Members of this process group (processes whose process group
ID is equal to the current terminal process group ID) receive keyboard-
generated signals such as SIGINT. These processes are said to be in
the foreground. Background processes are those whose process group ID
differs from the terminal's; such processes are immune to keyboard-gen-
erated signals. Only foreground processes are allowed to read from or,
if the user so specifies with stty tostop, write to the terminal."
In the process substitution, the process runs asynchronously in the
background. In the () subshell, the process does not run asynchronously
and is in the foreground process group.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/