From: "Choi, Junegunn" Date: 2009-02-25T17:12:05+09:00 Subject: Re: Can Ruby interact with the shell sh ? As Adam suggested, you could use a pipe. Open a pipe to the program in read-write mode, so you can read from it and write to it. A simple example: IO.popen('./some_command', 'r+') do | pipe | while line = pipe.gets do puts " ** #{line}" if line =~ %r{y/n} pipe.puts 'y' end end end -- junegunn.