Answer the question
In order to leave comments, you need to log in
bash. How to redirect stderr and stdout to one file and stderr to another?
Hello.
I need to write a bash script that will write both stdout and stderr to one file and stderr to another at the same time.
I tried to write like this:
{ python app.py 2>&1 2>&3 1>&3 | python log.py err; } 3>&1 | python log.py out
Answer the question
In order to leave comments, you need to log in
(( echo stderr >&2 ; echo stdout ) 3>&2- 2>&1- 1>&3- | tee stderr ) 2>&1 | tee stdout+stderr
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question