Subject: Re: bug#21919: tee enhancement

From: Bernhard Voelker <[email-masked]>
Date: Mon, 16 Nov 2015 08:06:18 +0100

On 11/14/2015 05:00 PM, Tim Shaw wrote:
> What I would like to do is add a parameter to tee, "-2", that copies to stderr in addition to stdout, just like "-"
> copies to stdout twice. So the code becomes
>     echo big long complicated error message goes here | tee -2
> Simple, eh?

Having an additional option to refer to a certain file descriptor
sounds worthwhile and tempting.  OTOH, you can already refer to
/dev/stderr as a file name for the 2nd file descriptor already
on many/most systems:

  echo big long complicated error message goes here | tee /dev/stderr

Does this work for you?

> Where's the tee source? I know this would not be POSIX compliant, but it would work for me, and I hate having to rewrite
> everything from scratch for trivial stuff like this.

http://git.savannah.gnu.org/cgit/coreutils.git/tree/README-hacking

Have a nice day,
Berny