This does what I want:
--8<---------------cut here---------------start------------->8---
_tee_stderr ()
{
<<'____eohd'
SYNOPSIS
ourname
DESCRIPTION
Use in a pipe. Leaks STDIN to STDERR. Passes STDIN to STDOUT unchanged.
EXAMPLE
$ seq 5 |_tee_stderr |tail -2 > /tmp/bar ; echo;cat /tmp/bar
1
2
3
4
5
4
5
____eohd
( tmpf=$( mktemp ~/tmp/$FUNCNAME.XXX );
cat > $tmpf;
cat $tmpf 1>&2;
cat $tmpf;
rm -f $tmpf );
return;
}
--8<---------------cut here---------------end--------------->8---
What is better/cleaner?
--
thanks!