标签: bash pipe
我有两个Python文件,data-writer.py和logs-writer.py。前者将stdin写入foo.data;后者将stdin写入foo.log。
data-writer.py
logs-writer.py
foo.data
foo.log
给定一个进程p,如何将其stdout传递给data-writer.py的stdin,将stderr传递给logs-writer.py的stdin?
p
答案 0 :(得分:2)
使用流程替换
p > >(data-writer.py) 2> >(logs-writer.py)