Bash: how do I pipe stdout and stderr of one process to two different processes? -
i have process myprocess1
produces both stdout , stderr outputs. want pipe 2 output streams 2 different downstream processes, myprocess2
, myprocess3
, massage data , dump results 2 different files. possible single command? if not, 2nd best running 2 separate commands, 1 process stdout
, other stderr
. in case, first run be:
myprocess1 | myprocess2 > results-out.txt
what similar command process stderr
? thx
without fancy games should work:
{ myprocess1 | myprocess2 > results-out.txt; } 2>&1 | myprocess3 > results-err.txt
with fancy games (which not work in /bin/sh
, etc.) this:
myprocess1 2> >(myprocess3 > results-err.txt) | myprocess2 > results-out.txt
Comments
Post a Comment