标签: c pipe stdout stdin
我想用exevcp执行一个进程(让我们说ls -l)。我希望它的输出转到多个进程的输入。我不知道管道是否可行。有人能帮助我吗?
答案 0 :(得分:1)
根据评论中的建议,查看tee的工作方式可能是最佳选择。但是,为简单起见,为什么不在你的过程中使用外壳和三通?
tee
your_process | tee >(process1) >(process2)
供参考:OS X / Linux: pipe into two processes?