Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Net::Telnet - How to send keystrokes like ESC

4 views
Skip to first unread message

Babu Raj

unread,
Nov 26, 2009, 9:28:23 AM11/26/09
to
Hi
Could you pls let me know how I can send in keystrokes such as ENTER and
ESC to a telnet session. I have the session created using
Net::Telnet.new().
--
Posted via http://www.ruby-forum.com/.

Ryan Davis

unread,
Nov 26, 2009, 3:32:41 PM11/26/09
to

On Nov 26, 2009, at 06:28 , Babu Raj wrote:

> Could you pls let me know how I can send in keystrokes such as ENTER and
> ESC to a telnet session. I have the session created using
> Net::Telnet.new().

Depends on what you're trying to do. Either something like this:

http://groups.google.com/group/ruby-talk-google/browse_frm/thread/96cabb08c34182c/77c0843d27e95dd3?lnk=gst&q=berger+password&rnum=1#77c0843d27e95dd3

or you want to look at expect.rb.


Brian Candler

unread,
Nov 26, 2009, 3:46:58 PM11/26/09
to
Babu Raj wrote:
> Hi
> Could you pls let me know how I can send in keystrokes such as ENTER and
> ESC to a telnet session. I have the session created using
> Net::Telnet.new().

Have you tried

sess.puts

sess.print "\x1b"

?

0 new messages