$ ./myscript 3>&1 1>stdout.logfile 2>&3- | tee stderr.logfile
It in effect swaps stdin and stderr then closes file
descriptor 3 once it is finished. (the reason for the
- at the end of 2>&3-)
(I googled "tee standard error" ;-) Credit where it's due.
From: luv-main-bounces(a)luv.asn.au [mailto:firstname.lastname@example.org]
On Behalf Of Adam Bolte
Sent: Monday, 30 September 2013 5:54 PM
Subject: Re: Capturing output
On Mon, Sep 30, 2013 at 03:46:55PM +0800, Jay Amorin wrote:
Now I want to store the output (standard
out/error) to a log file for
future reference using this:
svnadmin dump -r1:100 --incremental /srv/my_repo > /srv/my_repo.1-
| tee /srv/my_repo.1-100.log
But seems not to work. Is this doable with bash or python?
I think that's taking standard output, and redirecting it to a
file. Then you're piping to tee, which doesn't really do anything since
you've already redirected standard output to a file.
svnadmin dump -r1:100 --incremental /srv/my_repo 2>&1 | tee
The 2>&1 bit makes standard error go to wherever standard output is
going, and then pipes standard output to tee.