Sunday, October 30, 2005

How to redirect and tee both stdout and stderr

Uh yeah... how did that work again, to run a UNIX command that shows both its STDOUT and STDERR on the console as usual, as progress report,yet writes both into separate files as well? Like this:

(rsync [...] | tee stdout.txt) 3>&1 1>&2 2>&3 | tee stderr.txt

Puh! (Thanks to this article for pointing me in the right direction.)


Post a Comment

<< Home