Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Garbage chars after remote login

Posted by neo (The Architect), 14 June 2005
I don't know if I have asked this question before   (I have been having the prob for a long time now)
I use an expect script to login to my remote machine.
After send'ing the username and password I am prompted for the term type (xterm?) to which I send a "\r"
I then do a interact. This works fine but if I do anything else (a send etc to telnet to another machine) I get garbage chars after the prompt appears and when I try to type a command.
It looks like some termcap chars (not really sure).

Is there anything I can do to avoid this garbage chars?

Posted by admin (Graham Ellis), 14 June 2005
Have you tried sending dumb\r or tty\r when asked for the terminal type?  I'm pretty sure that your analysis that they're termcap characters is correct, and if you say you're a dumbe terminal rather than the default (which may well be ANSI or VT100) then it should help.

Posted by neo (The Architect), 15 June 2005
Thanks a lot Graham. You are a genius  .
Works like a charm now.

Posted by neo (The Architect), 15 June 2005
Hi again,
           A friend wanted this script and so I gave it to him. He is now getting this same porblem. I went to his place and tried it out myself and saw that when he logs in he is not asked for the term type. (I think it assumes xterm)

Is there any workaround for this?

Posted by admin (Graham Ellis), 15 June 2005
Yes - he'll be able to send an extra command when he enters interact mode ... something like:
        export TERM=dumb

The exact command / format to use will depend on which shell he's using.

Posted by neo (The Architect), 17 June 2005
But the garbage chars come before the prompt appears.  

Posted by admin (Graham Ellis), 17 June 2005
You're using expect to establish the connection and get to the prompt in the first place, right?   In which case, an extra send / expect sequence (using a globbed or regex match to await the prompt no matter what terminal mode is set as default) should do the trick  



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho