Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!noao!arizona!rupley From: rupley@arizona.edu (John Rupley) Newsgroups: comp.unix.wizards Subject: Re: Script for setting TERM type Message-ID: <2553@megaron.arizona.edu> Date: Sun, 25-Oct-87 17:06:19 EST Article-I.D.: megaron.2553 Posted: Sun Oct 25 17:06:19 1987 Date-Received: Tue, 27-Oct-87 04:57:22 EST References: <155@wa3wbu.UUCP> <5093@columbia.edu> Organization: U of Arizona CS Dept, Tucson Lines: 50 Summary: Non-interactive set of TERM type In article <5093@columbia.edu>, francus@cheshire.columbia.edu (Yoseff Francus) writes: > In article <155@wa3wbu.UUCP> john@wa3wbu.UUCP (John Gayman) writes: > > > > Im running Microport Sys V/AT on an AT-clone. Can anyone give me > >a shell script for setting the Terminal type at login time. I use the > > > I use the following lines at the beginning of my .profile and > it works fine. If I don't specify any terminal it defaults to hds. > > echo "TERM (hds): \c";read TERM > if [ "${TERM}" = "" ] > then > TERM=hds > fi > export TERM TERMCAP LOGNAME EDITOR You can set TERM without the need for user response at logon, by including the following code in .profile and constructing a datafile, /etc/termfile, that associates a terminal type with a tty-port. The code works for microport sysV/AT. It is written for direct tty connections. For modem connections you might want to grep for logname and change the termfile appropriately. INCLUDE IN .PROFILE TERM=ansi aaa=`/bin/grep \`/bin/tty\` /etc/termfile | /usr/bin/cut -d" " -f3` if [ $aaa ] then TERM=$aaa fi export TERM CREATE /ETC/TERMFILE (EXAMPLE FOLLOWS) console /dev/console ansi cons1 /dev/cons1 ansi cons2 /dev/cons2 ansi cons3 /dev/cons3 ansi room1 /dev/tty4C otrona room2 /dev/tty4E otrona eric /dev/tty4B tvi john /dev/tty4D otrona John Rupley uucp: ..ihnp4!arizona!rupley voice: 602-325-4533