perl, v5.8.0 built for sun4-solaris SunOS 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-250
to
HP-UX B.11.11 U 9000/800 (tc)
with the simple script
my $t = new Net::Telnet (Timeout => 30, Prompt => '/[:\$%#>] $/'); $t->input_log(\*STDOUT); $t->telnetmode(1); $t->open($hostip); $t->login($user, $pass);
Logon works. My problem is that after logon, the expected prompt doesn't show up in the input (which is the output of the remote server). Rather, I get a strange escape sequence like:
.^[ i^M ... ^M.^[* ... ^MTERM = (hp)
I'm supposing this is a control stream, but I can't find any reference to handling them in Net::Telnet except for telnetmode() which I explicitly turn on. (Turning it off causes logon to fail.) Prompt on the remote host is '$'.
Anyone see what I'm doing wrong, or how I can workaround the problem? TIA!
P.S. I would try Expect, but unfortunately it is not available everywhere I need to use this.
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
In reply to Net::Telnet problem w/ escape sequences (control stream?) by Solo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |