I would just use the system for it. But if you really want to do it in
you could do something like this:
ps aux | grep firefox.split("\n")
process_list.each do |process|
process = process.split(’ ')
command ||= 
command << process.last
pid ||= 
pid << process
Then you can kill stuff based on command to your hearts content.
On Mon, Mar 30, 2009 at 9:49 PM, Eric M. [email protected]
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
I’m really new to Ruby – how can I best accomplish this? Thanks.
Posted via http://www.ruby-forum.com/.
“Hey brother Christian with your high and mighty errand, Your actions
so loud, I canâ€™t hear a word youâ€™re saying.”
-Greg Graffin (Bad Religion)