Ask a Question related to PERL Modules, Design and Development.
-
SebMuller #1
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
-
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!!! -
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... -
#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... -
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... -
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... -
Brian McCauley #2
Re: send "Ctrl ]" to the remote system
[email]sebastian.mueller@etsi.org[/email] (SebMuller) writes:
There is no need to encode it in any special way.> 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 ]"?
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
-
SebMuller #3
Re: send "Ctrl ]" to the remote system
Brian McCauley <nobull@mail.com> wrote in message news:<u97k50gypi.fsf@wcl-l.bham.ac.uk>...
You are absolutely right. Actually the question is: What has to be> [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.
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
-
SebMuller #4
Re: send "Ctrl ]" to the remote system
Brian McCauley <nobull@mail.com> wrote in message news:<u9u182dlyq.fsf@wcl-l.bham.ac.uk>...
I found the following solution for sending Ctrl-A to the remote> [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.
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
-
Brian McCauley #5
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)..That is not as neat as the methods explained in is the manual>> >> > > > > 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);
page to which I directed you.
Of course it doesn't I exaplain why above where I said "I suspect to> Unfortunately the above does not work for Ctrl-]. I needed Ctrl-] only
> to exit the telnet session correctly.
are confused". You have now confirmed my suspicion.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
Brian McCauley Guest



Reply With Quote

