|
From: | Pierre Gaston |
Subject: | Re: (read -r var) vs <(read -r var) behavior |
Date: | Tue, 19 May 2015 08:42:12 +0300 |
On 5/16/15 1:11 PM, marzevd@gmail.com wrote:
> Bash Version: 4.3
> Patch Level: 30
> Release Status: release
>
> Description:
> from interactive shell running cat < <(read -r var) prints:
> bash: read: read error: 0: Input/output error
>
> on the other hand:
> (read -r var) reads chars from terminal stdin
>
>
> Repeat-By:
> cat < <(read var)
I'm not sure what the question is here. The two constructs are totally
different in effect and implementation. The error comes because the
process substitution is run asynchronously, in the same process group as
the calling shell (though exactly which pgrp doesn't matter), and the
`cat' process runs in a different process group and `owns' the terminal.
In the second (subshell) example, none of these things is true.
--
``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] |