- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Prompting for terminal type
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
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
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
02-02-2004 09:25 AM
02-02-2004 09:25 AM
everything in my .profile that I can think of.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 09:27 AM
02-02-2004 09:27 AM
Re: Prompting for terminal type
# Set terminal type
echo "terminal: \c"
read TERM
case $TERM in
300) stty cr2 nl0 tabs; tabs;;
300s) stty cr2 nl0 tabs; tabs;;
450) stty cr2 nl0 tabs; tabs;;
hp) stty cr0 nl0 tabs; tabs;;
745|735) stty cr1 nl] -tabs; TERM=745;;
43) stty cr1 nl0 -tabs;;
*) echo "$TERM unknown";;
esac
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 09:27 AM
02-02-2004 09:27 AM
Solutionread ttype
TERM=$ttype
export TERM
SEP+
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 09:32 AM
02-02-2004 09:32 AM
Re: Prompting for terminal type
print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
print -n "Terminal Type (v/V=vt220scc; a/A=aixterm)?"
read Type
if [ "$Type" = "v" ] || [ "$Type" = "V" ]
then
export TERM=vt220scc
elif [ "$Type" = "a" ] || [ "$Type" = "A" ]
then
export TERM=aixterm
else echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
echo "\t\t\t Wrong choice !!!\007"
sleep 3
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 09:34 AM
02-02-2004 09:34 AM
Re: Prompting for terminal type
As for reading a termional type in .profile, nothing more complicated than:
echo "Enter Terminal Type: \c"
read TTYPE
is required. The first question to ask is "Are you actually running .profile?" . If you a doing a CDE login then you need to makesure that the line "DTSOURCEPROFILE=true" is not commented out in .dtprofile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 09:38 AM
02-02-2004 09:38 AM
Re: Prompting for terminal type
I mean, there may well be a reason to ask explicitly, but perhaps an automated procedure is nicer for your users?
Check out 'man tttype'
Here is what my /etc/profile (standard) reads:
# set term if it's not set
if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" \
-o "$TERM" = "network" ]
then
eval `ttytype -s -a`
fi
export TERM
You may also want to study 'man tset', 'man tty' and 'man stty' for further toughts.
Hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 01:34 PM
02-02-2004 01:34 PM
Re: Prompting for terminal type
So the reason you are asked for a terminal is that whatever you are using is not a Wyse, VT100-style or HP terminal. Or you have configured the terminal or emulator not to respond to status queries. You can comment out the ttytype line but you'll only be abe to use the command line. Running an editing program like like vi requires a valid TERM setting. TERM is a translator that tells programs like vi how to move around on the screen. Manually setting TERM to a random value (ie, no connection the the real terminal you are using) will cause vi and other menu programs to fail.
What type of terminal or emulator are you using?
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 05:19 PM
02-02-2004 05:19 PM
Re: Prompting for terminal type
Test the ttytype command on your terminals before using it. There are known issues with terminals that hang when ttytype tries to identify them.
One thing to bear in mind: DONT PUT IT IN /etc/profile !!! Or check if you have a valid tty before requesting the ttytype. The tty command can be used for this.
Any script you run with su -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 05:52 PM
02-02-2004 05:52 PM
Re: Prompting for terminal type
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2004 12:42 AM
02-03-2004 12:42 AM
Re: Prompting for terminal type
if tty -s
then
eval ($ttytype -s)
tabs
tput reset
fi
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2004 09:02 AM
02-06-2004 09:02 AM