From: Jia Zhang Date: 2006-06-14T16:30:07+09:00 Subject: Does Ruby expect module support multiple selections? Hi, I want to use PTY.spawn(some shell program) and then use expect method to decide what should be inputed next step. But my shell program output is not fixed. It depends on the environment on which it runs. So my question is, does ruby support multiple expect? If so, my code can be like: PTY.spawn(my shell program) do |reader, writer, pid| reader.expect(/a|b/) do |str| if str.match(/a/) do something else do something else end end Thanks very much! -- Posted via http://www.ruby-forum.com/.