From: Lon Baker Date: 2006-04-14T03:08:36+09:00 Subject: Re: IO stream help Thanks for all the help. I came up with the following code that works. run = true $stdout.sync = true while run input,output,error = IO::select( [$stdin], nil, nil, nil ) (input||[]).each {|s| chunks = s.readline.split case chunks[1] when /INTF/ $stdout.puts "#{chunks[0]} #{chunks[1]} #{chunks[2]}" when /QUIT/ $stdout.puts "#{chunks[0]} OK" run = false else $stdout.puts "#{chunks[0]} OK" end } end This is used in a helper application for Communigate Pro mail servers. -- Posted via http://www.ruby-forum.com/.