Discussion:
special characters from plink telnet connection but not putty GUI-start
(too old to reply)
s***@gmail.com
2015-08-12 15:24:46 UTC
Permalink
C:\Users\Public\Downloads>plink -load HP_Procurve_Telnet
←[2J←[?7l←[3;23r←[?6l←[1;1H←[?25l←[1;1HHP J9147A E2910al-48G Switch
Software revision W.15.08.0012

I started encountering this issue when adapting a Powershell utility (that works for Cisco switches) to telnet to HP Procurve switches.
MS telnet from Windows command window showed no such problem. i.e. that *is* usable but I want to find a way to deal with the hidden characters to go back to my powershell code.
Putty shows no such problem (i.e. it translates away or filters these characters).
I even tried saving the session from Putty and using this in plink call but that did not circumvent the issue.

here is what plink returns:
Please register your products now at: www.hp.com/networking/register

←[1;22r←[1;1H←[1;24r←[22;1H←[24;1HUsername: ←[?25h←[24;1H←[?25h←[24;11H←[24;11H←[?25h←[24;11H←[1;1H←[?25l
←[24;11H←[24;1H
←[?25h←[24;11H←[1;24r←[24;1H←[24;1HPassword: ←[?25h←[24;1H←[?25h←[24;11H←[1;1H←[?25l←[24;11H←[24;1H
←[?25h←[24;11H←[1;24r←[24;1H←[24;1HInvalid password←[?25h←[24;1H←[24;1H
←[?25h←[24;1H←[?25h←[24;1H←[1;24r←[24;1H←[24;1HUsername: ←[?25h←[24;1H←[?25h←[24;11H←[24;11H←[?25h←[24;11
H

I have tried UTF-8 (default) and Latin in Putty to modify the saved session but no success.

What do I have to do on this connection to filter out the extra characters ?
s***@gmail.com
2015-08-12 16:04:38 UTC
Permalink
http://h30499.www3.hp.com/t5/ProCurve-ProVision-Based/How-to-get-correct-output-when-telnet-to-HP-ProCurve/td-p/5322661#.VcttyvlViko

and

http://www.termsys.demon.co.uk/vtansi.htm

look promising but I haven't finished understanding how this maps onto actual command lines and transfer options.
s***@gmail.com
2015-08-12 16:12:33 UTC
Permalink
...can I simply filter bytes or do I need to be concerned with characters taking up double-bytes ? I can powershell code that but not sure how to filter with plink if using command line.
Lőrinczy Zsigmond
2015-08-15 18:01:43 UTC
Permalink
What do you really want? What is the goal of this?
Executing commands on the remote computer?

C:\> plink ***@p520ora "cat /etc/motd"
***@p520ora's password:
************************************************
* Welcome to AIX Version 8.2! *
************************************************

Loading...