Net::Telnet - How to send keystrokes like ESC

Discussion in 'Ruby' started by Babu Raj, Nov 26, 2009.

  1. Babu Raj

    Babu Raj Guest

    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/.
     
    Babu Raj, Nov 26, 2009
    #1
    1. Advertising

  2. Babu Raj

    Ryan Davis Guest

    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.
     
    Ryan Davis, Nov 26, 2009
    #2
    1. Advertising

  3. 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/.
     
    Brian Candler, Nov 26, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucas Tam
    Replies:
    5
    Views:
    6,277
    WizyDig
    Dec 2, 2004
  2. Replies:
    6
    Views:
    664
  3. Replies:
    0
    Views:
    331
  4. Jim Isaacson
    Replies:
    5
    Views:
    628
    Default User
    Nov 5, 2004
  5. Carcarius
    Replies:
    0
    Views:
    328
    Carcarius
    Dec 6, 2007
Loading...

Share This Page