Net::Telnet - How to send keystrokes like ESC

  • Follow


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/.

0
Reply Babu 11/26/2009 2:28:23 PM

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/96cabb08=
c34182c/77c0843d27e95dd3?lnk=3Dgst&q=3Dberger+password&rnum=3D1#77c0843d27=
e95dd3

or you want to look at expect.rb.


0
Reply Ryan 11/26/2009 8:32:41 PM


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"

?
-- 
Posted via http://www.ruby-forum.com/.

0
Reply Brian 11/26/2009 8:46:58 PM

2 Replies
679 Views

(page loaded in 0.038 seconds)

Similiar Articles:













7/20/2012 2:41:24 PM


Reply: