in reply to Background process using a system call
The child that you forked (which you now have the pid of) will terminate when your system command does, thus emulating the behavior you're looking for.my @pids; foreach my $wks (@wkslist) { my $pid = fork; if ($pid == 0) { # child print "rshing to $wks \n"; system("$rsh_cmd $wks ls"); exit; } else { push(@pids,$pid); } } foreach my $pid (@pids) { waitpid($pid,0); }
/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Background process using a system call
by mugwumpjism (Hermit) on Aug 21, 2001 at 04:45 UTC | |
by maverick (Curate) on Aug 21, 2001 at 05:09 UTC |