N
Nate Murray
Hey All, I got this code straight from the PickAxe:
trap("CLD") {
pid = Process.wait
puts "Child pid #{pid}: terminated"
exit
}
exec("echo 'hello world'") if fork == nil
But it doesnt word!
The CLD trap'ped call never executes.
Another question... If I perform the exec 4 times the trap call back
should be called four times, right?
So this code:
trap("CLD") {
pid = Process.wait
puts "Child pid #{pid}: terminated"
exit
}
1.upto(4) do
exec("echo \"hello $HOSTNAME #{Process.pid}\n\" ; sleep 5") if
fork.nil?
end
Should call trap("CLD") four times, right?
Thanks for your help in advance.
trap("CLD") {
pid = Process.wait
puts "Child pid #{pid}: terminated"
exit
}
exec("echo 'hello world'") if fork == nil
But it doesnt word!
The CLD trap'ped call never executes.
Another question... If I perform the exec 4 times the trap call back
should be called four times, right?
So this code:
trap("CLD") {
pid = Process.wait
puts "Child pid #{pid}: terminated"
exit
}
1.upto(4) do
exec("echo \"hello $HOSTNAME #{Process.pid}\n\" ; sleep 5") if
fork.nil?
end
Should call trap("CLD") four times, right?
Thanks for your help in advance.