|
From: | Pierre Gaston |
Subject: | Re: (read -r var) vs <(read -r var) behavior |
Date: | Fri, 22 May 2015 15:19:15 +0300 |
On 5/19/15 1:42 AM, Pierre Gaston wrote:
> The question really is (I discussed this with him on IRC) why can you do:
>
> $ cat <(read var </dev/tty;echo $var)
> blah
> blah
>
> but not:
>
> $ cat < <(read var </dev/tty;echo $var)
> bash: read: read error: 0: Input/output error
I'm not sure where you can do this; I get EIO for both constructs on Mac
OS X, Fedora 21, RHEL 6, and Solaris 11 (what I happened to have available
today).
The kernel returns -1/EIO because the shell started to run the process
substitution is ignoring SIGTTIN and the process attempts to read
from its controlling terminal (/dev/tty) while the terminal's process
group is set to different process group (making that shell a background
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/
[Prev in Thread] | Current Thread | [Next in Thread] |