I have a utility which uses Expect.pm to send commmands to telecomms devices. It works really well most of the time but in some instances i cant get the end device to recognise the control character sequence to disconnect from the device.
I'm quite conversant with the Expect syntax for sending control characters and have tried various permutations but to no avail.
When logged in manually to the device when you type:-
CTRL (keep pressed then press)
p
d
t
It works.
In expect if i send - ^cp^cd^ct - it sends ^P^D^T and doesnt disconnec
+t me.
If i send \020\004\024 it sends ^P^D^T and doesnt disconnect me.
Ive also tried sending it using ->send_slow - but its not being recognised.
This is running from a Solaris box with TERM=vt220 - telnetting into a Windows telnet server and then using putty plink to rlogin into a remote switch.
A colleague of mine uses the same connectivity and an Aspect script to connect to these devices for a different purpose and to disconnect uses the sequence:-
TermKEY Ctrl 'p'
TermKEY Ctrl 'd'
TermKEY Ctrl 't'
I wonder if anyone else has had an issue with control characters not being acted upon correctly and what their resolution was.
Regards
Simon
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.