Re: [Help-bash] How to create a real copy of file descriptors stdout / s
From:
João Eiras
Subject:
Re: [Help-bash] How to create a real copy of file descriptors stdout / stderr?
Date:
Mon, 27 Feb 2017 16:30:29 +0100
On 27 February 2017 at 15:03, Patrick Schleizer
<address@hidden> wrote:
> João Eiras:
>> Why not just...
>>
>> $ unbuffer apt-get "$@" > 1> >(tee -a ) 2> >(tee -a "$logfile" >&2)
>
> Generally good idea. Did not work for me, but the following does...
>
> unbuffer apt-get "$@" 1> >(tee -a "$logfile") 2> >(tee -a "$logfile" >&2)
>
Yeah, two errors in my example. Just typed it on my webmail :)
> In this case I like to have stdout and stderr in the same log file so
> it's looking the same as if manually run.
Then you can redirect stderr to stdout
$ unbuffer apt-get "$@" 1> >(tee ...) 2>&1
Or do you want to keep the file descriptors separate ? I've done that
but it's more tricky.