According to Wikipedia, โProcess substitution can also be used to capture output, which usually goes to a file, and redirects it to process input." ( http://en.wikipedia.org/wiki/Process_substitution ).
So, in my opinion, this means that with the replacement of the process, I can take the output of command A and use it as input to command B. In other words, it's like a pipe (is this right?).
So, if this is true, and if I do this:
echo "test" >(wc)
then I should expect to get the following:
1 1 5
because my understanding of the above command is similar to the following:
$echo "test" > tmp $wc tmp 1 1 5 tmp
except that I am not making a tmp file with a replacement process.
But instead, I get the following output:
test /dev/fd/63
This, obviously, indicates that my mental model is wrong. Where am I mistaken?
I understand the <(command) command. for instance
$diff <(head file1) <(head file2)
makes perfect sense. but not> (command).
source share