From: Lars Mai Date: 2009-09-30T19:08:26+09:00 Subject: Re: if process.exist then . . . ??? > pids = [] > ProcTable.ps{ |s| > pids.push(s.pid) if s.cmdline =~ /calc/ > > } How about this: calc_is_running = ProcTable.ps.any? {|pinfo| pinfo.cmdline =~ /calc/ } # returns true or false or if you need the pid of the process later on: calc_processes = ProcTable.ps.select {|pinfo| pinfo.cmdline =~ /calc/ } # returns an array of matching processes if calc_processes.empty? .... else ... hth, - Lars -- Posted via http://www.ruby-forum.com/.