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 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
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., 2022: 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