Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!ut-sally!franklin From: franklin@ut-sally.UUCP (Maurice T. Franklin) Newsgroups: net.unix Subject: Re: csh question Message-ID: <4892@ut-sally.UUCP> Date: Sun, 11-May-86 18:09:16 EDT Article-I.D.: ut-sally.4892 Posted: Sun May 11 18:09:16 1986 Date-Received: Wed, 14-May-86 07:40:19 EDT References: <673@brl-smoke.ARPA> Reply-To: franklin@sally.UUCP (Maurice T. Franklin) Organization: U. Texas CS Dept., Austin, Texas Lines: 58 Keywords: tset csh login Summary: use tset, not case In article <673@brl-smoke.ARPA> DZOEY@umd2.umd.edu (Joe) writes: >Hi, I'm trying to revamp my .login, and part of it is to check to see >which terminal type (if any) the system think I'm signing in on. > >I implement this by a large switch statement. It looks something like. > >switch ($term) >case 'type1': >case 'type2': > . > . > . >case 'typen: > breaksw > >and then the appropriate code if it matches any one of those. The problem >I'm running into is I get a >case: Too many labels >error. What is the maximum number of labels I can have for a single action? >right now, I have about 20, but I could probably cut it down to 5 if I had to. > >Any help would be appreciated. > > Thanks, > Joe > >HERMAN@UMD2.UMD.EDU There is a command, tset, that does all this for you. You just tell it what type of terminal to set up the in shell for a given login terminal type. Tset is a rather complex command, but the man page is pretty good. Here is part of the man page for tset: ---- EXAMPLES export TERM; TERM=`tset - -m '>1200:vt100' 2621` export TERM; TERM=`tset -e -k^U -Q - -m 'switch<=1200:concept100' -m 'switch:?vt100' -m dialup:concept100 -m arpanet:dm2500` ---- and here is part of my .login: ---- # Set up terminal type and modes. set termdefault = vt100 set noglob eval `tset -s -n -e -k^U -m 'network:?$termdefault' -m 'sun:sun' -m 'dialup:st' -m 'unknown:?$termdefault'` unset noglob ---- Hope this is of help to you, and anyone else who has trouble (like I have had) getting the shell to recognize your terminal. "Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clark Maurice T. Franklin CS Dept University of Texas at Austin UUCP: {ihnp4,seismo,harvard,gatech}!ut-sally!franklin ARPA Internet and CSNET: franklin@sally.utexas.edu [Disclaimer: The University of Texas at Austin, the Computer Science Dept, nor just about anybody else, is to be held responsible for what I say here.]