将进程的标准输出重定向到多个管道 [英] Redirect stdout of a process to more than one pipe

查看:96
本文介绍了将进程的标准输出重定向到多个管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 exevcp 执行一个进程(比如说 ls -l).我希望它的输出进入多个进程的输入.如果管道可以实现,我不知道.有人可以帮我吗?

I want to execute a process with exevcp (let's say ls -l). I want the output of that to go to the input of more than one process. I don't if that is possible with pipes. Can someone help me ?

推荐答案

查看 tee 的工作原理,正如评论中所建议的那样,可能是要走的路.但是,为简单起见,为什么不使用外壳并将 tee 本身包裹在您的流程中呢?

Looking at how tee works, as suggested in the comments, might be the way to go. However, for simplicity, why not use a shell and tee itself wrapped around your process?

your_process | tee >(process1) >(process2)

参考:OS X/Linux:管道进入两个进程?

这篇关于将进程的标准输出重定向到多个管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆