help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] How unnamed pipe is done in bash?


From: Chet Ramey
Subject: Re: [Help-bash] How unnamed pipe is done in bash?
Date: Thu, 19 Jan 2017 18:27:58 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

On 1/19/17 4:51 PM, Peng Yu wrote:
> Hi, I don't quite understand who unamed pipe is done in bash. It seems
> unnamed pipe is mapped to a fd in /dev/fd/<id>. 63 is always used as
> the first one. Why the 2nd command won't run correctly?
> 
> $ cat <(echo xxx)
> xxx
> $ cat $(echo <(echo xxx))
> cat: /dev/fd/63: Bad file descriptor

Think about the parent-child relationship.  The process substitution is
valid in the subshell spawned to run the command substitution.  The parent
shell doesn't know anything about it.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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