How can I pipe the output of one command to the input of two other commands simultaneously?
It sounds like the
The key is to use
for process substitution. With
So if you wanted to use the output of
The results of the
This will send the output of the grep command to both the terminal and to wc (whose output is in turn redirected to the file grepresult).
"Tee" is explained in the Wikipedia article tee (command). Central is: "The tee command reads standard input, then writes its content to standard output and simultaneously copies it into the specified file(s) or variables.".