in reply to Re: Understanding fork
in thread Understanding fork

In the parent process, fork() returns the process ID of the new child. So in that process, you redirect the user, and exit. (At least, I THINK you should exit, but you're falling out of that else clause in your sample, and doing the while twice...).

How do you prevent that?

Neil Watson
watson-wilson.ca

Replies are listed 'Best First'.
Re: Re: Re: Understanding fork
by RMGir (Prior) on Nov 08, 2002 at 18:21 UTC
    Where you have the comment about redirecting the user, add
    $SIG{CHLD}='IGNORE'; exit;
    That way, the parent process will exit immediately, hopefully without waiting for the child process.
    --
    Mike