1 2 3 4 5 6 7 8 9 |
#!/usr/bin/env ruby -wKU
trap('SIGINT') {STDERR << " ← receive\n" }
fork {sleep 0.5; STDERR << " ← send\n"; Process.kill('SIGINT', Process.ppid) }
%x{true}
pid = fork {exec('sleep', '4') }
Process.wait(pid)
|
Pastie
Show Pastie some love
or read my new blog
1 2 3 4 5 6 7 8 9 |
#!/usr/bin/env ruby -wKU
trap('SIGINT') {STDERR << " ← receive\n" }
fork {sleep 0.5; STDERR << " ← send\n"; Process.kill('SIGINT', Process.ppid) }
%x{true}
pid = fork {exec('sleep', '4') }
Process.wait(pid)
|