
How do I write stderr to a file while using "tee" with a pipe?
I know how to use `tee` to write the output (`STDOUT`) of `aaa.sh` to `bbb.out`, while still displaying it in the terminal:
./aaa.sh | tee bbb.out
How would I now also write `STDERR` to a file named `ccc.out`, while still having it displayed?
More
1 Expert Answer
Suman R. answered 10/13/20
Tutor
New to Wyzant
Java and Computer Science Tutor
you can do the following
./aaa.sh 2>ccc.out | tee bbb.out
bbb.out will have STDOUT
ccc.out will have STDERR
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Anthony B.
Which shell are you using? echo $SHELL05/26/19