Re:Using the Unix Chainsaw: Named Pipes and Process Substitu...
by turnersd on Friday August 09, 2013 @08:12AM
(#6185115)
Awesome - I never new about process substitution. I wanted to convince myself I knew what it was doing, so I started kicking this around a bit. I expected the first command to output "test." I'm not sure I can explain these results:
[ Parent
| on HN ]
Re:Using the Unix Chainsaw: Named Pipes and Process Substitu...
by vsbuffalo on Saturday August 10, 2013 @03:24AM
(#6190339)
<(blah) runs the command blah, and pipes its standard output to a file descriptor (/dev/fd/63) above. You shell replaces the <(blah) with a path to the this file descriptor, so here, echo is just printing the file descriptor name.
Since echo test prints "test" to standard out, in your second example this is piped to the file descriptor, which cat then reads from (printing "test").