setting TERM (arguments to login(1))

Paul S. R. Chisholm psc at lzwi.UUCP
Mon Sep 16 13:02:12 AEST 1985


from the System V Release 1 login(1):
	The environment may be expanded or modified by supplying
	additional arguments to login, either at execution time or when
	login requests your login name.  The arguments may either take
	the form xxx or xxx=yyy.  Arguments without an equal sign are
	placed in the environment as
		Ln=xxx
	where n is a number *starting* *at* *0* [emphasis mine] and is
	incremented each time a new variable name is required.
	Variables containing an = are placed into the environment
	without modification. . . . There are two exceptions.  The
	variables PATH and SHELL cannot be changed. . . .  Both login
	and getty understand simple character quoting conventions.
	Typing a backslash in front of a character quotes it and allows
	the inclusion of such things as spaces and tabs.

Thus, you can get things such as:
	login:  psc hp
which (depending on how you write your .profile), either sets TERM,
overides a default setting of TERM to a terminal you use all the time,
or precludes .profile for prompting for and reading a terminal name.

Note that the first argument *after* the login name is assigned to
L0 (ell zero), not L1 (ell one).  Also, I have vague memories of the L0
shell variable being set, but not exported.

Neither getty(1M) online (SVR2 on a Vax) nor gettydefs(4) from the same
manual as quoted above make any mention of this feature.  Maybe they
mean that in /etc/inittab, you can have TERM=foo at the beginning of the
process string?  (But "sh -c 'exec FOO=bar ...'" doesn't seem to work
well.)
-- 
       -Paul S. R. Chisholm       The above opinions are my own,
       {pegasus,vax135}!lzwi!psc  not necessarily those of any
       {mtgzz,ihnp4}!lznv!psc     telecommunications company.
       (*sigh* ihnp4!lzwi!psc does *NOT* work!!!  Use above paths.)
"Of *course* it's the murder weapon.  Who would frame someone with a fake?"



More information about the Comp.unix mailing list