open a program with a read/write I/O stream and handle data in both directions
handle = IO.popen("other_program", "r+") handle.puts "send input to other program" handle.close_write while line = handle.gets puts line end