in reply to Re: How do I get the process ID from a system("x &") call?
in thread How do I get the process ID from a system("x &") call?
Thanks guys!my $pid = fork(); if ($pid ==0) { unless(fork){ print "Child launched!\n"; exec"/bin/sleep 10"; # server process exit 0; } exit 0; } waitpid($pid,0); $pid=$pid+1; // cheating process ids are 1+ what we think they a +re print "Child PID: $pid\n"; push @pidArray, $pid; }
|
|---|