简体   繁体   中英

Can I pipe stderr to `foo`'s stdin and stdout to `bar`'stdin?

I have two Python files, data-writer.py and logs-writer.py . The former writes stdin to foo.data ; the latter writes stdin to foo.log .

Given a process p , how do I pipe its stdout to data-writer.py 's stdin, and stderr to logs-writer.py 's stdin?

使用流程替换

p > >(data-writer.py) 2> >(logs-writer.py)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM