How do you get the parent process id of a process that is not the current process in Ruby?
I've checked Ruby's Process module, but it only seems to provide a means to access the PPID of the current process.
I also checked google for anything on the subject, but the first two pages seemed to only contain links regarding how to use the aforementioned Process module.
I was hoping to do this without having to rely too much on the underlying OS, but whatever works.
Shell out:
1.9.3p429 :001 > `ps -p 7544 -o ppid=`.strip
=> "7540"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With