[comp.sources.d] multitee and me

brooks@sundance7.DAB.GE.COM (05/03/90)

  At the risk of sounding stupid...

  After looking at the multitee posting from comp.sources.unix, I'm still
not really sure how someone might use it.  Anyone have some neat ideas or
suggestions?

--
Stephen (Steve) M. Brooks       | brooks@ge-dab.GE.COM   | "Mr. Ranger isn't
GE Simulation & Control Systems | ...!mcnc!ge-dab!brooks | gonna like this,
P.O. Box 2825, Rm. 4150         | Voice: (904) 239-4855  | Yogi." -- Boo Boo
Daytona Beach, FL  32115-2825   | Dial-Comm: 8*620-4855  |

brnstnd@stealth.acf.nyu.edu (05/04/90)

In article <4206@ge-dab.GE.COM> brooks@ge-dab.GE.COM (Stephen M. Brooks) writes:
>   After looking at the multitee posting from comp.sources.unix, I'm still
> not really sure how someone might use it.  Anyone have some neat ideas or
> suggestions?

Well, it's used in several spots in the authutil package, where input 0
has to be piped to socket 6 while socket 6 is piped to socket 1. (That's
multitee 0:6 6:1.) For this you could use a multiple cat; multitee's
only real advantage is that it's just one process.

cat fails when you're sending an input to several output pipes. tee can
only solve a restricted version of this, and it can block waiting for
one output when it should be sending through the other. The situation
can get really hairy when the other end of the pipe doesn't know how to
handle nonblocking I/O; there's no per-process fcntl(). multitee neatly
solves all these problems.

One really convenient use of multitee is for setting up truly invisible
temporary files in shell scripts. Look at the trivial inews shell script
inside authutil, for example.

Other applications will pop up, I'm sure. What's the use of tee?

---Dan