Broken process substitution

Eric Blake
Fri Aug 13 20:26:00 GMT 2010

On 08/13/2010 02:17 PM, Eric Blake wrote:
> On 08/13/2010 02:04 PM, Daniel Colascione wrote:
>> Try "echo hello > >(cat)" -- that's supposed to output "hello".
> What makes you think it's supposed to echo hello?  That's system
> specific on what will happen.  According to the bash manual,
>> (cat)
> is evaluated first, and will result in a /dev/fd reference, or a named
> pipe (it so happens that it is a /dev/fd reference in cygwin).  But this
> pipe is tied to the subprocess, so it only exists as long as the
> subprocess exists.

Then again, cat should exist until something causes the input side of
its pipe to declare EOF; so I guess there's no race in this example
after all.  Rather, it looks like a limitation in cygwin1.dll.  I don't
know why bash is unable to duplicate the output end of the pipe to the
echo process, unless cygwin's /dev/fd handling doesn't work on pipes.
But that's highly likely that you are dealing with yet another one of
cygwin's pipe handling shortfalls.

Eric Blake    +1-801-349-2682
Libvirt virtualization library

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Cygwin mailing list