Redirecting stderr
to file and duplicating stdout
to both file and terminal is easy:
$ prog 2>error.log | tee output.log
tee
will duplicate stdout
, printing it to both terminal and output.log
.
But what about redirecting stdout
to file, and duplicating stderr
to both terminal and file? How can that be accomplished? is there a tee
equivalent that will duplicate stderr
instead of stdout
?