Testing for TERM type


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Testing for TERM type
# 1  
Old 10-06-2010
Testing for TERM type

There are times where I want to use putty(vt100 TERM) and hummingbird (XTERM) is there a way to test what terminal connection I am using in my .profile so I can set my commands like stty erase correctly.
# 2  
Old 10-06-2010
Code:
echo $TERM

# 3  
Old 10-06-2010
Franklin,

The command I was looking for is termdef but my question still stands, how does termdef know what to return, ie vt100, xterm..... is there a series of tests that are done first to determine the value being returned.

I checked my .profile is empty, I checked my /etc/profile and here is the code we have


# If termdef command returns terminal type (i.e. a non NULL value),
# set TERM to the returned value, else set TERM to default lft.
TERM_DEFAULT=lft
TERM=`termdef`
TERM=${TERM:-$TERM_DEFAULT}
# 4  
Old 10-06-2010
Do a man on 'tset'.
# 5  
Old 10-07-2010
tset is mostly out-dated I changed my code do something like this as I hate having hard-coded values.

DTERM=$TERM
echo "\nTerminal [$DTERM]: \c"
read TERM
TERM=${TERM:-$DTERM}

Thanks for the input
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Testing Data Type of User Input

hi all i'm new in shell scripting and now i'm working on project and i wanna make a function take input from user and test it's datatype then if correct write it to file i wounder what is the best way to do this ? can i use awk ? edit by bakunin: Please give your threads a meaningful... (5 Replies)
Discussion started by: mohamed91
5 Replies

2. Shell Programming and Scripting

killproc -term

Hi, I am trying the function killproc -term and it seems to be doing something extra that kill <pid> doesn't do. My daemon cleanly terminates using kill, but not using killproc. I tried strace on killproc and then killproc works well. I read online that strace ignores SIGSTOP. does that mean... (4 Replies)
Discussion started by: fosfat
4 Replies

3. Solaris

Console Login with Term Type

I have a sunfire v480 and a v440 that both have an issue with logging into the text based console as opposed to JDE. It looks like the text is wrapping around, because it is too long for the screen. When I run something like `system-unconfig` i get something that looks like this. ... (2 Replies)
Discussion started by: mcdef
2 Replies

4. Programming

array type has incomplete element type

Dear colleagues, One of my friend have a problem with c code. While compiling a c program it displays a message like "array type has incomplete element type". Any body can provide a solution for it. Jaganadh.G (1 Reply)
Discussion started by: jaganadh
1 Replies

5. Shell Programming and Scripting

String type to date type

Can one string type variable changed into the date type variable. (1 Reply)
Discussion started by: rinku
1 Replies

6. Shell Programming and Scripting

Search term and output term in desired field

Hi All, I have an input_file below and i would like to use Perl to search for the term "aaa" and output the 3rd term in the same row as "aaa".For Example, i want to search for the term "ddd" and would want the code to ouput the 3rd term in the same row which is "fff". Can somebody help ? ... (28 Replies)
Discussion started by: Raynon
28 Replies

7. Shell Programming and Scripting

Help with TERM script

I am trying to amend an existing TERM script to prompt the end user for a password - then take that password and add it to a specific part of an existing file. Here is what I have - BUT - I am confusing Unix with Term and my script does not like what I added b/c the script simply runs through... (1 Reply)
Discussion started by: Surdeymon
1 Replies

8. Programming

Create a Term & Run chars on this Term

hi floks ! i'd like to know how can i transmete a character or a string from my source code to a term and make it interpret or un by the shell wich is running in my term. I'd like to create a Term from my code (and get its file descriptor) and then transmete each char typed on the keyboard to... (1 Reply)
Discussion started by: the_tical
1 Replies

9. UNIX for Dummies Questions & Answers

X-Term for Windows

Hi Everyone, I need some information from all of you guys. I generally work on a Solaris OS in my school and I had heard that I can download something called X-Term on a Windows system and still work on some of the graphical things on windows which generally work only on unix. This is what I... (5 Replies)
Discussion started by: yelamarthi
5 Replies
Login or Register to Ask a Question