bug-bash
[Top][All Lists]
Advanced

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

Re: (read -r var) vs <(read -r var) behavior


From: Pierre Gaston
Subject: Re: (read -r var) vs <(read -r var) behavior
Date: Fri, 22 May 2015 15:19:15 +0300



On Wed, May 20, 2015 at 4:12 AM, Chet Ramey <chet.ramey@case.edu> wrote:
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/

I get that on Centos 5.5 (linux 2.6.18) but I am indeed unable to reproduce it on other systems.
 


reply via email to

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