From: Aria Stewart Date: 2007-10-26T06:27:53+09:00 Subject: Re: Pricess ID On Oct 25, 2007, at 7:25 AM, Arul hari wrote: > Fish Man wrote: >> Hi, >> if I start a process in Ruby using the system("some process") >> how can I get the process id of the process I've just started? >> >> Cheers. >> Dan. > > Dear Fish Man, > This is very simple.Just you can use Process.pid. > For instance, > I wll give some example, > I am having one file: > 1.rb > system("ps") =>execute the process > p Process.pid =>it will tell the current process Id. But not the one launched by system. You probably want to use something other than system -- popen, fork/ exec, something like that