I know about
program1 | program2
and
program1 | tee outputfile | program2
but is there a way to feed program1's output into both program2 and program3?
You can do this with tee and process substitution.
tee
program1 | tee >(program2) >(program3)
The output of program1 will be piped to whatever is inside ( ), in this case program2 and program3.
program1
( )
program2
program3
2.1m questions
2.1m answers
62 comments
56.6k users