在bash中使用两个命令读取相同的stdin

dr_*_*dom 6 bash pipe

我想将 bash 中的两个单独命令 <2,3> 的输出通过管道传输。这样做的最佳方法是什么?目前,我有以下脚本:

command source > output
command2 output &
command3 output &
Run Code Online (Sandbox Code Playgroud)

输出文件大约为 100G,一种次优的方式是分别通过管道传输到命令 2 和 3。我认为有可能做得更有效。

JRo*_*ert 11

在 bash 中: command source | tee >(command2) >(command3)

这个stackoverflow问题。我还没有用巨大的输出尝试过这个。