- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Set TERM value with tty command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 09:06 PM
тАО10-22-2003 09:06 PM
I have a case when i execute command tty on console:
$tty
/dev/tty1 or /dev/tty2 or etc
And when i execute command tty on client machine:
$tty
/dev/pts/0 or /dev/pts/1 or etc
How to make a script that can set $TERM in two conditions:
if tty=/dev/tty* then set $TERM=vt100
else set $TERM=ansi
Thanks in advance for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 09:09 PM
тАО10-22-2003 09:09 PM
Re: Set TERM value with tty command
then
TERM=ansi
else
TERM=vt100
fi
export TERM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 09:16 PM
тАО10-22-2003 09:16 PM
Re: Set TERM value with tty command
There is a file called "/etc/ttytype" (see man 4 ttytype) into which you can put these values, one line per terminal.
Then in your profile, add a "tset" command which reads the file and sets the TERM.
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`
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 09:39 PM
тАО10-22-2003 09:39 PM
Re: Set TERM value with tty command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 10:24 PM
тАО10-22-2003 10:24 PM
Re: Set TERM value with tty command
You need to put the commands into your .profile in your home directory, and log in again.
Or save to a textfile, and say ". ./textfile".
Note - dot space dot slash -- important
-- Graha,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 10:44 PM
тАО10-22-2003 10:44 PM
Re: Set TERM value with tty command
'. ./trm' in your case. Or put the lines in your .profile. Calling trm from your .profile will not work either.
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.
I hope this answer is better then the previous one ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 10:56 PM
тАО10-22-2003 10:56 PM
Re: Set TERM value with tty command
below is it's history:
$tty
/dev/pts/0
$TERM=vt100;export TERM
$ ./trm
$ echo $TERM
vt100
more trm
if tty | grep -q /pts/
then
TERM=ansi
else
TERM=vt100
export TERM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 10:57 PM
тАО10-22-2003 10:57 PM
Re: Set TERM value with tty command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 11:01 PM
тАО10-22-2003 11:01 PM
Re: Set TERM value with tty command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2003 11:06 PM
тАО10-22-2003 11:06 PM
Solution