question about perl's exec
Here's part of my perl program:
if (my $pid = fork) {
waitpid($pid, 0);
print "end exec\n";
}
else {
defined($pid) or die "fork: $!";
print "start exec\n";
exec "ssh -f $opt_s ping -c 10 $opt_d > pingout";
}
I want to do other things after the ping ends.
But it turns out that the parent proc continue to do the following command while ping is still running.
Can you tell me how to write the correct program to such thing?
Thanks a lot.
|