# This example runs the netstat command via a pipe # and processes the data in Ruby as it come back pipe = IO.popen("netstat 3") while (line = pipe.gets) print line print "and" end