How can I split and re-join STDOUT from multiple processes?
问题 I am working on a pipeline that has a few branch points that subsequently merge-- they look something like this: command2 / \ command1 command4 \ / command3 Each command writes to STDOUT and accepts input via STDIN. STDOUT from command1 needs to be passed to both command2 and command3, which are run sequentially , and their output needs to be effectively concatenated and passed to command4. I initially thought that something like this would work: $ command1 | (command2; command3) | command4