Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Dec 1998 14:09:06 +1100
From:      "John Saunders" <john.saunders@scitec.com.au>
To:        "Michael Ryan" <mike@NetworX.ie>, "Jonathan Chen" <jonc@pinnacle.co.nz>
Cc:        "FreeBSD Support" <questions@FreeBSD.ORG>
Subject:   RE: Mystery with pipe(), fork() and dup()
Message-ID:  <003f01be2d58$6fc9f130$6cb611cb@saruman.scitec.com.au>
In-Reply-To: <ECS9812220153E@NetworX.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
> I know.  In the context of my program
> 	if (pid == 0)
> means the child process will execute the code, whereas
> 	if (pid)
> means the parent process will execute the code.

In the context of your program, (pid == 0) means that the
output of grep is piped into more. But for (pid) it means
that the output of more is piped into grep. A certain
recipe for screwing up the output of more.

Cheers.
--   .   +-------------------------------------------------------+
 ,--_|\  | John Saunders    mailto:John.Saunders@scitec.com.au   |
/  Oz  \ | SCITEC LIMITED   Phone +61294289563  Fax +61294289933 |
\_,--\_/ | "By the time you make ends meet, they move the ends." |
      v  +-------------------------------------------------------+


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003f01be2d58$6fc9f130$6cb611cb>