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.

echo $TERM

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}

Do a man on 'tset'.

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