From: Brian Candler Date: 2011-04-19T18:18:00+09:00 Subject: Re: Telnet "More?" Eric T. wrote in post #993311: > t.cmd('dir', &out) > t.cmd('dir', &out) t.cmd is really shorthand for t.puts followed by t.waitfor So you could try something like this: def cmd_or_more(str, &blk) t.puts str loop do res = t.waitfor(/:.*>|More\?/, &blk) break if res =~ /:.*>/ t.puts "" end end t.cmd_or_more('dir', &out) t.cmd_or_more('dir', &out) Of course, if the question is really "why does Microsoft hang with a 'More?' prompt when dir is issued a second time", then this isn't really the right solution. It would be better if you could issue some command to the CLI to say "no pager" - like "term len 0" on a Cisco router. Regards, Brian. -- Posted via http://www.ruby-forum.com/.