Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) Newsgroups: comp.unix.wizards Subject: Re: Script for setting TERM type Message-ID: <7701@steinmetz.steinmetz.UUCP> Date: Mon, 26-Oct-87 16:06:06 EST Article-I.D.: steinmet.7701 Posted: Mon Oct 26 16:06:06 1987 Date-Received: Wed, 28-Oct-87 05:44:25 EST References: <155@wa3wbu.UUCP> <5093@columbia.edu> <2553@megaron.arizona.edu> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 33 A solution was suggested to look at the output of /bin/tty for the terminal id, and do a lookup. Using "who am i" will allow this to work on BSD as well. set `who am i` # now $1 is user, $2 is port case $2 in con*) # this is the console ;; ttyXX) # any hardwired line of known type here ;; *) # dialin lines here case $1 in user1) # decode each user ;; case2) # and set type ;; *) # default, ask... echo "Enter terminal type:" read ttype esac esac TERM=$ttype ; export TERM Hope this helps. If you are only concerned with yourself, put this in your personal .profile and eliminate the user tests. For general use put in /etc/profile. Some csh user could post a version for csh, I haven't done the exercise. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me