Unix Programming - Re: Need help with piping

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2004 > Re: Need help with piping





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Need help with piping
Barry Margolin

2004-11-19, 8:47 pm

In article <pan.2004.11.20.00.20.42.368463@optonline.net>,
"Diane M. Napolitano" <dianemn@optonline.net> wrote:

> On Fri, 19 Nov 2004 16:08:01 -0800, William Ahern wrote:
>
>
> Interestingly enough, that did help. My
> program no longer runs in an infinte loop when I try to run piped
> commands...but now it just executes the first program in the pipe and
> returns to the prompt. Should I only fork once, or once for each process
> in the pipe?


You need to fork for each process, and then call wait() in a loop until
they all exit.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com