Re: Child process executing tasks of parent process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It’s not the point of this distribution list to discuss Perl, but fork will return the process id for both processes. A simple pattern for the source code looks like:

pid = fork();
if (pid==0){print "do the child things";}
else {print "do parent things"}

You want to aim your script semantics according to the pid. This is because the source code is executed by both processes.

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux