<?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: Set TERM value with tty command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100329#M146741</link>
    <description>Hi Graha, I have done your advice but still not take any effect, why ??&lt;BR /&gt;below is it's history:&lt;BR /&gt;$tty&lt;BR /&gt;/dev/pts/0&lt;BR /&gt;$TERM=vt100;export TERM&lt;BR /&gt;$ ./trm&lt;BR /&gt;$ echo $TERM&lt;BR /&gt;vt100&lt;BR /&gt;more trm&lt;BR /&gt;if tty | grep -q /pts/&lt;BR /&gt;then&lt;BR /&gt;TERM=ansi&lt;BR /&gt;else&lt;BR /&gt;TERM=vt100&lt;BR /&gt;&lt;BR /&gt;export TERM</description>
    <pubDate>Thu, 23 Oct 2003 05:56:01 GMT</pubDate>
    <dc:creator>george_114</dc:creator>
    <dc:date>2003-10-23T05:56:01Z</dc:date>
    <item>
      <title>Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100323#M146735</link>
      <description>Please help me, I am newbie in Unix.&lt;BR /&gt;I have a case when i execute command tty on console:&lt;BR /&gt;$tty&lt;BR /&gt;/dev/tty1 or /dev/tty2 or etc&lt;BR /&gt;&lt;BR /&gt;And when i execute command tty on client machine:&lt;BR /&gt;$tty&lt;BR /&gt;/dev/pts/0 or /dev/pts/1 or etc&lt;BR /&gt;&lt;BR /&gt;How to make a script that can set $TERM in two conditions:&lt;BR /&gt;if tty=/dev/tty*   then set $TERM=vt100  &lt;BR /&gt;else set $TERM=ansi&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Oct 2003 04:06:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100323#M146735</guid>
      <dc:creator>george_114</dc:creator>
      <dc:date>2003-10-23T04:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100324#M146736</link>
      <description>if tty | grep -q /pts/&lt;BR /&gt;then&lt;BR /&gt;TERM=ansi&lt;BR /&gt;else&lt;BR /&gt;TERM=vt100&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;export TERM</description>
      <pubDate>Thu, 23 Oct 2003 04:09:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100324#M146736</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-10-23T04:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100325#M146737</link>
      <description>Elmar is right, but there may be better ways.&lt;BR /&gt;&lt;BR /&gt;There is a file called "/etc/ttytype" (see man 4 ttytype) into which you can put these values, one line per terminal.&lt;BR /&gt;Then in your profile, add a "tset" command which reads the file and sets the TERM.&lt;BR /&gt;&lt;BR /&gt;Alternatively, there is a command, also called ttytype (see man 1 ttytype), which interrogates your terminal and decides what type it is. You can use the output to set the TERM variable, using  eval `ttytype -s`&lt;BR /&gt;&lt;BR /&gt;-- Graham&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Oct 2003 04:16:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100325#M146737</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-10-23T04:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100326#M146738</link>
      <description>hi Elmar, i have put your script to text file  called trm and run it but it does not take effect to my TERM value.</description>
      <pubDate>Thu, 23 Oct 2003 04:39:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100326#M146738</guid>
      <dc:creator>george_114</dc:creator>
      <dc:date>2003-10-23T04:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100327#M146739</link>
      <description>George&lt;BR /&gt;&lt;BR /&gt;You need to put the commands into your .profile in your home directory, and log in again.&lt;BR /&gt;&lt;BR /&gt;Or save to a textfile, and say ". ./textfile".&lt;BR /&gt;Note - dot space dot slash -- important&lt;BR /&gt;&lt;BR /&gt;-- Graha,</description>
      <pubDate>Thu, 23 Oct 2003 05:24:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100327#M146739</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-10-23T05:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100328#M146740</link>
      <description>Graham is right. If you call your script in a normal way, the environment variable is changed for that instance of your shell and its children. You want to change it for your current shell, so you have to run the commands with that shell. This can be done by calling the script with Graham's syntax,&lt;BR /&gt;'. ./trm' in your case. Or put the lines in your .profile. Calling trm from your .profile will not work either.&lt;BR /&gt;&lt;BR /&gt;The problem with using the ttytype database is that you have to specify a line for every tty possible... Or you use a default if it is not in the file, which means you have to only specify /dev/tty* entries as being vt100 and if your tty is not in /etc/ttytype it will be ansi.&lt;BR /&gt;&lt;BR /&gt;I hope this answer is better then the previous one ...</description>
      <pubDate>Thu, 23 Oct 2003 05:44:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100328#M146740</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-10-23T05:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100329#M146741</link>
      <description>Hi Graha, I have done your advice but still not take any effect, why ??&lt;BR /&gt;below is it's history:&lt;BR /&gt;$tty&lt;BR /&gt;/dev/pts/0&lt;BR /&gt;$TERM=vt100;export TERM&lt;BR /&gt;$ ./trm&lt;BR /&gt;$ echo $TERM&lt;BR /&gt;vt100&lt;BR /&gt;more trm&lt;BR /&gt;if tty | grep -q /pts/&lt;BR /&gt;then&lt;BR /&gt;TERM=ansi&lt;BR /&gt;else&lt;BR /&gt;TERM=vt100&lt;BR /&gt;&lt;BR /&gt;export TERM</description>
      <pubDate>Thu, 23 Oct 2003 05:56:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100329#M146741</guid>
      <dc:creator>george_114</dc:creator>
      <dc:date>2003-10-23T05:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100330#M146742</link>
      <description>You miss a '. ' when calling trm.</description>
      <pubDate>Thu, 23 Oct 2003 05:57:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100330#M146742</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-10-23T05:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100331#M146743</link>
      <description>Hi Elmar, i have put . when i run this script like $ ./trm but still not make any effect.Why ????</description>
      <pubDate>Thu, 23 Oct 2003 06:01:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100331#M146743</guid>
      <dc:creator>george_114</dc:creator>
      <dc:date>2003-10-23T06:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set TERM value with tty command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100332#M146744</link>
      <description>You run it from the current directory by using the './' (dot slash), but to run it in your current shell, you have to add '. ' (dot space). Graham put that info in his first post too.</description>
      <pubDate>Thu, 23 Oct 2003 06:06:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/set-term-value-with-tty-command/m-p/3100332#M146744</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-10-23T06:06:17Z</dc:date>
    </item>
  </channel>
</rss>

