in reply to forking and exec
#avoid zombies $SIG{CHLD} = 'IGNORE'; # check if it works on your system for (1..100) { my $pid = fork; next if $pid; # in parent, go on warn($!), next if not defined $pid; # parent, fork errored out exec @cmd; # in child, # go do @cmd and don't come back }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: forking and exec
by Anonymous Monk on Oct 22, 2013 at 13:59 UTC | |
by kennethk (Abbot) on Oct 22, 2013 at 16:31 UTC | |
by Anonymous Monk on Oct 22, 2013 at 19:51 UTC |