I base the following question off How can I split and re-join STDOUT from multiple processes? .
The following Bash command splits the output of command1
into two streams going into command2
and command3
before combining their outputs and piping it into command4
.
((command1 | tee >(command2 >&3) | command3) 3>&1) | command4
Graphically this looks as follows:
command2
/ \
command1 command4
\ /
command3
How would i do this in the Sh shell?