🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.d
Article #761

Re: multitee and me

#761
From: brnstnd
Date: Thu, 03 May 1990 23:04
24 lines
1638 bytes
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
Technical Details
Message-ID: <19494:May323:04:0290@stealth.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!stealth.acf.nyu.edu!brnstnd
References: <4206@ge-dab.GE.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!stealth.acf.nyu.edu!brnstnd
From: brnstnd@stealth.acf.nyu.edu
Newsgroups: comp.sources.d
Subject: Re: multitee and me
Message-ID: <19494:May323:04:0290@stealth.acf.nyu.edu>
Date: 3 May 90 23:04:02 GMT
References: <4206@ge-dab.GE.COM>
Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein)
Distribution: usa
Organization: IR
Lines: 24