send "Ctrl ]" to the remote system

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default send "Ctrl ]" to the remote system

    Hi,

    I am using the telnet module (Telnet.pm) in order to automate some
    unix-sessions.
    It works so far great, but during the telnet session I would like to
    send the escape character ("Ctrl ]") to the remote system.
    How shall I encode "Ctrl ]"?

    Thanks, Sebastian
    SebMuller Guest

  2. Similar Questions and Discussions

    1. how to get a file from the "Testing Server" / "remote view"
      if I want to get a particular file from the "Testing Sever" or "remote view" in my extension, how can i do so? Thanks a lot!!!
    2. Undoing "Break apart" (ctrl-B)
      On 2005-04-19, timberfish <com> wrote: > On 2005-04-19 07:31:04 -0700, Toby <com> said: > >> On 2005-04-14, timberfish <com> wrote: >>> On...
    3. #25366 [NEW]: form buttons of type "image" dont send "submit" $_POST variable in IE
      From: jordanolsommer at imap dot cc Operating system: Windows XP PHP version: 4.3.2 PHP Bug Type: Variables related Bug...
    4. Lsass.exe System error "object name not found". System keeps rebooting
      When trying to install the drivers for the PCI modem in my laptop, prompted for the driver CD. Installed the driver without any errors but asked...
    5. Since when UNIX is the "real" system that runs the "real" machines?
      *CROSS POSTED TO comp.unix.solaris In article <o3FNa.611731$vU3.43623@news1.central.cox.net>, David Janes <djanes@cox.net> wrote: Yes, Unix...
  3. #2

    Default Re: send "Ctrl ]" to the remote system

    [email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
    > I am using the telnet module (Telnet.pm) in order to automate some
    > unix-sessions.
    > It works so far great, but during the telnet session I would like to
    > send the escape character ("Ctrl ]") to the remote system.
    > How shall I encode "Ctrl ]"?
    There is no need to encode it in any special way.

    I suspect you are confused. The Ctrl-] character is not special in
    the telnet connection.

    The Ctrl-] character is special in the stream between a controlling
    terminal and the Unix telent program. But you are not using the Unix
    telnet program.

    --
    \\ ( )
    . _\\__[oo
    .__/ \\ /\@
    . l___\\
    # ll l\\
    ###LL LL\\
    Brian McCauley Guest

  4. #3

    Default Re: send "Ctrl ]" to the remote system

    Brian McCauley <nobull@mail.com> wrote in message news:<u97k50gypi.fsf@wcl-l.bham.ac.uk>...
    > [email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
    >
    > > I am using the telnet module (Telnet.pm) in order to automate some
    > > unix-sessions.
    > > It works so far great, but during the telnet session I would like to
    > > send the escape character ("Ctrl ]") to the remote system.
    > > How shall I encode "Ctrl ]"?
    >
    > There is no need to encode it in any special way.
    >
    > I suspect you are confused. The Ctrl-] character is not special in
    > the telnet connection.
    >
    > The Ctrl-] character is special in the stream between a controlling
    > terminal and the Unix telent program. But you are not using the Unix
    > telnet program.
    You are absolutely right. Actually the question is: What has to be
    send to make the remote system (Unix) execute the command Ctrl-A or
    Ctrl-C etc.
    Because $t->cmd("Ctrl-A") won't do it (see below).
    Perhaps ASCII code?
    ----------------------------------------------------------------
    use Net::Telnet();
    $t = new Net::Telnet (-timeout => 10, -prompt => '/$prompt $/');
    ....
    @lines = $t->cmd("Ctrl-A");
    ----------------------------------------------------------------
    SebMuller Guest

  5. #4

    Default Re: send "Ctrl ]" to the remote system

    Brian McCauley <nobull@mail.com> wrote in message news:<u9u182dlyq.fsf@wcl-l.bham.ac.uk>...
    > [email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
    >
    > > Brian McCauley <nobull@mail.com> wrote in message news:<u97k50gypi.fsf@wcl-l.bham.ac.uk>...
    > > > [email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
    > > >
    > > > > I am using the telnet module (Telnet.pm) in order to automate some
    > > > > unix-sessions.
    > > > > It works so far great, but during the telnet session I would like to
    > > > > send the escape character ("Ctrl ]") to the remote system.
    > > > > How shall I encode "Ctrl ]"?
    > > >
    > > > There is no need to encode it in any special way.
    > > >
    > > > I suspect you are confused. The Ctrl-] character is not special in
    > > > the telnet connection.
    > > >
    > > > The Ctrl-] character is special in the stream between a controlling
    > > > terminal and the Unix telent program. But you are not using the Unix
    > > > telnet program.
    > >
    > > You are absolutely right. Actually the question is: What has to be
    > > send to make the remote system (Unix) execute the command Ctrl-A or
    > > Ctrl-C etc.
    > > Because $t->cmd("Ctrl-A") won't do it (see below).
    > > Perhaps ASCII code?
    >
    > You now appear to be asking how to encode non-printable characters in
    > Perl string literals. This is explained in perlop/"Quote and
    > Quote-like Operators". (I will not criticise you for not finding that
    > yourself, thinking of a string literal as an operator is not intuative
    > to all!)
    >
    > Note that Ctrl-C may, depending on context, be different. You may not
    > actually want to sent the ASCII Ctrl-C in-band but rather the Telnet
    > "interrupt process" command.
    I found the following solution for sending Ctrl-A to the remote
    system:
    ## SEND CTRL+A
    $var_0=chr(1);
    @lines=$t->print($var_0);

    Unfortunately the above does not work for Ctrl-]. I needed Ctrl-] only
    to exit the telnet session correctly. Instead of Ctrl-] is use
    therefore directly "exit".
    SebMuller Guest

  6. #5

    Default Re: send "Ctrl ]" to the remote system

    [email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
    > Brian McCauley <nobull@mail.com> wrote in message news:<u9u182dlyq.fsf@wcl-l.bham.ac.uk>...
    > > [email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
    > >
    > > > Brian McCauley <nobull@mail.com> wrote in message news:<u97k50gypi.fsf@wcl-l.bham.ac.uk>...
    > > > > [email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
    > > > >
    > > > > > I am using the telnet module (Telnet.pm)..
    > > > > > How shall I encode "Ctrl ]"?
    > > > >
    > > > > There is no need to encode it in any special way.
    > > > >
    > > > > I suspect you are confused. The Ctrl-] character is not special in
    > > > > the telnet connection.
    > > > >
    > > > > The Ctrl-] character is special in the stream between a controlling
    > > > > terminal and the Unix telent program. But you are not using the Unix
    > > > > telnet program.
    > > >
    > > > You are absolutely right. Actually the question is: What has to be
    > > > send to make the remote system (Unix) execute the command Ctrl-A or
    > > > Because $t->cmd("Ctrl-A") won't do it (see below).
    > >
    > > You now appear to be asking how to encode non-printable characters in
    > > Perl string literals. This is explained in perlop/"Quote and
    > > Quote-like Operators".
    >
    > I found the following solution for sending Ctrl-A to the remote
    > system:
    > ## SEND CTRL+A
    > $var_0=chr(1);
    > @lines=$t->print($var_0);
    That is not as neat as the methods explained in is the manual
    page to which I directed you.
    > Unfortunately the above does not work for Ctrl-]. I needed Ctrl-] only
    > to exit the telnet session correctly.
    Of course it doesn't I exaplain why above where I said "I suspect to
    are confused". You have now confirmed my suspicion.

    --
    \\ ( )
    . _\\__[oo
    .__/ \\ /\@
    . l___\\
    # ll l\\
    ###LL LL\\
    Brian McCauley Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139