From: Glen Holcomb Date: 2009-03-31T23:13:32+09:00 Subject: Re: How to get list of all processes and the kill by name --0016e64418dc82a15904666acd63 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I would just use the system for it. But if you really want to do it in Rub= y you could do something like this: process_list =3D `ps aux | grep firefox`.split("\n") process_list.each do |process| process =3D process.split(' ') command ||=3D [] command << process.last pid ||=3D [] pid << process[1] end Then you can kill stuff based on command to your hearts content. On Mon, Mar 30, 2009 at 9:49 PM, Eric Milford wrote= : > I am working on a scraper that blows up if an instance of Firefox is > already running (launched via Firewatir) so I want to put in code that > first checks for any existing Firefox processes and issues a kill to > their PIDs. > > I'm really new to Ruby -- how can I best accomplish this? Thanks. > -- > Posted via http://www.ruby-forum.com/. > > --=20 "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can=92t hear a word you=92re saying." -Greg Graffin (Bad Religion) --0016e64418dc82a15904666acd63--