From: Casper H.S. Dik on
Seebs <usenet-nospam(a)seebs.net> writes:

>On 2010-04-21, Tobiah <toby(a)rcsreg.com> wrote:
>>>> If tee had a flag like that, I could see the data on stderr, while
>>>> still piping it to the receiving process.

>>>> Is there some other way to do this?

>>> ... | tee /dev/fd/2 | ...

>> That's pretty neat. How portable is that?

>On modern systems, "pretty portable". I think I've seen /dev/stderr
>as far back as 10-20 years ago.


Certainly available in Solaris 2.1 as /dev/fd/ ('92)

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
From: Jean-Rene David on
* Tobiah [2010.04.20 20:16]:
> It would be nice if I could see the output,
> but still redirect the output to a pipe:
>
> data_maker | tee --use_stderr | data_taker

You already got some answers using /dev/fd/0. Here is
another solution. It's not as pretty, but I think it's more
portable:

$ { printf "foo\n" | tee fileA 1>&3 | wc -l > fileB } 3>&1
foo
$ cat fileA
foo
$ cat fileB
1

HTH,

--
JR