csh question

Maurice T. Franklin franklin at ut-sally.UUCP
Mon May 12 08:09:16 AEST 1986


In article <673 at brl-smoke.ARPA> DZOEY at 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:    <some appropriate action for types 1-n inclusive>
>                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 at 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 at 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.] 



More information about the Comp.unix mailing list