<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Garbage characters when user telnets in in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184209#M795413</link>
    <description>Hi,&lt;BR /&gt;What is the enviro variable TERM set to in the users .profile ?</description>
    <pubDate>Thu, 05 Feb 2004 10:44:42 GMT</pubDate>
    <dc:creator>Leif Halvarsson_2</dc:creator>
    <dc:date>2004-02-05T10:44:42Z</dc:date>
    <item>
      <title>Garbage characters when user telnets in</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184208#M795412</link>
      <description>Has anyone come across this issue before?  I have one user account that when they telnet in to my HP, they see garbage characters and no prompt until they hit return.  From that point on, they can work normally.  See the attached screen shot to view exactly what I mean.</description>
      <pubDate>Thu, 05 Feb 2004 10:37:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184208#M795412</guid>
      <dc:creator>Robert Funk_1</dc:creator>
      <dc:date>2004-02-05T10:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Garbage characters when user telnets in</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184209#M795413</link>
      <description>Hi,&lt;BR /&gt;What is the enviro variable TERM set to in the users .profile ?</description>
      <pubDate>Thu, 05 Feb 2004 10:44:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184209#M795413</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2004-02-05T10:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Garbage characters when user telnets in</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184210#M795414</link>
      <description>&lt;BR /&gt;The sequence you show corresponds with trying to set TAB  stops, probably from the 'tabs' command. See: man tabs.&lt;BR /&gt;&lt;BR /&gt;Apparently your login scripts (/etc/profile? ~/.profile ? .cshrc ? ) uncoditionally blast the victims terminals.&lt;BR /&gt;&lt;BR /&gt;You want to make this conditional. using something like (no solution, just hints):&lt;BR /&gt;&lt;BR /&gt;   if [ ! "$VUE" ]; then&lt;BR /&gt;&lt;BR /&gt;   # set term if it's not set&lt;BR /&gt;&lt;BR /&gt;        if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup"  \&lt;BR /&gt;             -o "$TERM" = "network" ]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also check out ttytype and tset&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Feb 2004 11:04:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184210#M795414</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-02-05T11:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Garbage characters when user telnets in</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184211#M795415</link>
      <description>This can occur from corrupt pty variables.&lt;BR /&gt;&lt;BR /&gt;insf -e has helped me in the past with this, I don't know why it works though.&lt;BR /&gt;&lt;BR /&gt;Also if there is a particular pty thats bad, use rmsf on it first.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 05 Feb 2004 11:07:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184211#M795415</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-02-05T11:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Garbage characters when user telnets in</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184212#M795416</link>
      <description>&lt;BR /&gt;For some environment scripts I also tty -s &lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;tty -s&lt;BR /&gt;if ( $status == 0 ) stty erase "^?" &lt;BR /&gt;&lt;BR /&gt;&amp;gt; they see garbage characters&lt;BR /&gt;&lt;BR /&gt;That's not garbage... it just looks like garbage to the untrained eye :-)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Feb 2004 11:23:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184212#M795416</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-02-05T11:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Garbage characters when user telnets in</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184213#M795417</link>
      <description>These aren't garbage characters at all. They are escape sequences being sent to the terminal but the terminal doesn't recognize them, so the displayable characters are being shown. This is occuring somewhere after the mail check (which is usually in /etc/profile). If there isn't anything special at the end of profile, then it's in .profile. The codes start with [3g which is the code for clear-all-tab-stops. Now if you have TERM=vt100 or TERM=hp, tabs will not produce the codes you are seeing. So your value for TERM has been imporperly set.&lt;BR /&gt; &lt;BR /&gt;DON'T hardcode TERM=something in .profile!! There are hundreds of terminals (and imitations that run on PCs called 'emulators') out there and most Unix systems are well equipped to handle them all using a library called Curses. Curses defines generic features (like clear screen and clear tabs) but translates these into terminal-specific strings based on the value of TERM. In your case, [3g can be found using:&lt;BR /&gt; &lt;BR /&gt;untic vt100 | grep 3g&lt;BR /&gt;bel=^G, cr=\r, csr=\E[%i%p1%d;%p2%dr, tbc=\E[3g&lt;BR /&gt; &lt;BR /&gt;where untic decodes all the codes for the vt100 terminal. You see \E[3g which translates to ESC (the escape charater) plus [3g and the generic feature is called tbc. In the man page for terminfo (very lengthy) you'll see that tbc is clear all tabs.&lt;BR /&gt; &lt;BR /&gt;So start with:&lt;BR /&gt; &lt;BR /&gt;echo $TERM&lt;BR /&gt; &lt;BR /&gt;This setting is what tells the Curses library what terminal you have. Obviously, it doesn't match at all so it must have been hardcoded (or preset via telnet--more later). Remove any TERM= codes in .profile and replace it with:&lt;BR /&gt; &lt;BR /&gt;eval $(ttytype -s)&lt;BR /&gt; &lt;BR /&gt;As mentioned, you'll need to protect the ttytype command in case the login is run in batch mode (like su - username in a cron job). In batch mode, there is no controlling terminal, so you code it this way:&lt;BR /&gt; &lt;BR /&gt;if tty -s&lt;BR /&gt;then&lt;BR /&gt; eval $(ttytype)&lt;BR /&gt; tput reset&lt;BR /&gt; tabs&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;The code will only run if there is a real terminal login and sets TERM, COLUMNS, LINES and ERASE.&lt;BR /&gt; &lt;BR /&gt;Depending on what you are using (a PC, a Mac, a Linux box, etc) the handshake during telnet login can set TERM automatically (but you don't want that at all!). Using a subcode in the telnet handshake, your local box can provide a string that will be used to preset TERM even before /etc/profile runs. The problem is that there is little chance that the string provided has any relationship to the terminfo database in HP-UX. So use ttytype to ID the terminal and set TERM automatically.&lt;BR /&gt; &lt;BR /&gt;In the future, you can troubleshoot logins (ie, profile commands) by simply adding:&lt;BR /&gt; &lt;BR /&gt;set -x&lt;BR /&gt; &lt;BR /&gt;to /etc/profile and/or .profile which then traces each step of the script.</description>
      <pubDate>Thu, 05 Feb 2004 11:35:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/garbage-characters-when-user-telnets-in/m-p/3184213#M795417</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-02-05T11:35:43Z</dc:date>
    </item>
  </channel>
</rss>

