Date: Fri, 12 Jan 2001 01:20:06 GMT From: Salvo Bartolotta <bartequi@inwind.it> To: Francesco Casadei <fcasadei@inwind.it> Cc: freebsd-questions mailing list <freebsd-questions@freebsd.org> Subject: Re: Setting term capability in /etc/login.conf Message-ID: <20010112.1200600@bartequi.ottodomain.org> References: <20010111125818.A3300@goku.kasby>
next in thread | previous in thread | raw e-mail | index | archive | help
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 1/11/01, 12:58:18 PM, Francesco Casadei <fcasadei@inwind.it> wrote regarding Setting term capability in /etc/login.conf: > I've decided to change the localization settings. Previously I had a login > class for italian users in /etc/login.conf: > italian:Italian Users Accounts:\ > :charset=3DISO-8859-1:\ > :lang=3Dit_IT.ISO_8859-1:\ > :tc=3Ddefault: > In /etc/profile I had: > export TERM=3Dcons25l1 > and everything was fine. > Now I have removed the definition of the TERM variable from /etc/profile, > because not all users are in the italian login class. I have defined the term > capability in /etc/login.conf: > italian:Italian Users Accounts:\ > :charset=3DISO-8859-1:\ > :lang=3Dit_IT.ISO_8859-1:\ > :term=3Dcons25l1:\ > :tc=3Ddefault: > Then I have rebuilt the database with: > cap_mkdb /etc/login.conf > When a user in the italian login class logs in, he has the TERM environment > variable set to cons25 instead of cons25l1. I grep'd into config files= in /etc > and user's home directory to search for an explicit definition of the TERM > variable, but I couldn't find it. > As stated in the login.conf(5) man page: > ENVIRONMENT > Name Type Notes Description > [snip] > term string Default terminal type= if not > able to determine from other > means. > so I understand that TERM is not set to cons25l1 because the terminal type is > determined from "other means". Now the question is: what are these "other > means"? Francesco, The value of the TERM variable at login time seems to be, as it were, hardcoded in the third field of ttyv* lines in /etc/ttys. Specifying TERM in /etc/login.conf (cf setenv in login.conf(5)) doesn't work; specifying TERM in ~/.login_conf (by using setenv) doesn't work either. N.B. other variables (try eg PROVA=3Dproviamo in /etc/login.conf or in ~/.login_conf) ARE set. How come... :-) I am missing the reason (feature or bug ?) for the above-mentioned "hardcoding". I may be completely wrong, but I am afraid that you'll have to append one line containing the appropriate TERM variable to each of your Italian users' startup file. This single two-liner awk command should do the job: # awk -F : '$5 =3D=3D "italian" {if ($10 =3D=3D "/bin/tcsh/") system("ec= ho -n " "setenv TERM cons25l1"">>/usr/home/"$1"/.login")} {if ($10 =3D=3D "/usr/local/bin/bash/") system("echo -n " "export TERM=3Dcons25l1"">>/usr/home/"$1"/.bash_profile")}' /etc/master.passwd I am sure someone else will come up with either a solution or... a perl script :-) Regards, Salvo To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010112.1200600>