









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] Random questions #26 (now tee...)
I too have written this program, and let me tell you if you don't clean up
after your children correctly your forking processes may die or become
zombies. So in my opinion, write your program on a test server, cause you
may be bringing it to it's knees.
or use tee.
michael
On Sat, 13 Nov 2004 07:45:22 -0700, Aaron Birenboim wrote
> On Thu, 2004-11-11 at 18:55, Sarang wrote:
> > Short random questions (w/ footnotes) if anyone can help:
> >
> > % Can I pipe one program's stdout to 2 programs at the same time? [1]
>
> One could create a named pipe to one program, then use
> tee (see man tee) to send stdout to one program, AND
> the named pipe, which is stdin to another program.
>
> I could help you write a program, like tee, that would
> do this. I did something like this about a decade before.
>
> The program will take as arguments the two programs
> you want to pipe to.
> The program will fork these two programs off, retaining
> the handles for their stdin streams.
>
> Then this program can take its input, and print it out to
> BOTH of the stding streams. I bet it can be
> done in 30-50 lines.
> Some of the forks and device retaining stuff gets tricky
> (for a non-system-programming-guru like me at least)
>
> aaron
>
> _______________________________________________
> NMLUG mailing list
> NMLUG@nmlug.org
> http://www.nmlug.org/mailman/listinfo/nmlug
|
|