From: "Iñaki Baz Castillo" Date: 2008-04-18T06:12:19+09:00 Subject: Re: system(ping) El Jueves, 17 de Abril de 2008, Heinrich Piard escribió: > Hi, > > any idea how I can hand over each object of the array ip_list to the > system(ping) ? > > Here the code: > ip_list = ['192.168.1.1' , '192.168.1.2' , '192.168.1.3' , '192.168.1.4' > , '192.168.1.5' , '192.168.1.6' , '192.168.1.7' ] > > ip_list.each do |host| > system('ping -c 5' + host) > end use Ping class: require 'ping' ip_list.each do { |ip| Ping.pingecho(ip, 3) } -- Iñaki Baz Castillo