IT&&LINUX&&Config
IT LINUX K8S ETC OPEN SOURCE CONFIG PYTHON RUBY
Monday, March 24, 2014
Ping script with ruby
172:rp young$ cat ping.rb
require 'rubygems'
require 'net/ping'
if Net::Ping::External.new(ARGV[0]).ping
puts "Pong!"
else
puts "No response"
end
172:rp young$ ruby ping.rb www.google.com
Pong!
172:rp young$
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment