From: Mark Probert Date: 2004-05-14T22:58:50+09:00 Subject: Re: Telnet and out-of-band responses ------_=_NextPart_001_01C439BB.919FD458 Content-Type: text/plain I wrote: > > I need to limit the output, capture it, and terminate it. > More investigation showed that the message was in-band, just that My regexp was broken and lack of ensure was missing :-( For interest, the main loop looks a little like: flag = false begin @conn.write("#{cmd}\n") str = @conn.waitfor('Match' => /\$|\>|(to end display)/, 'Timeout' => timeout) flag = true if str =~ /to end display/ # 'q' needed rescue TimeoutError flag = true ensure @conn.write("q\n") if flag end -mark. ------_=_NextPart_001_01C439BB.919FD458--