Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 7/7/83; site rlgvax.UUCP Path: utzoo!linus!security!genrad!decvax!harpo!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: Should "su" change the USER environment variable? Message-ID: <1357@rlgvax.UUCP> Date: Wed, 2-Nov-83 11:42:24 EST Article-I.D.: rlgvax.1357 Posted: Wed Nov 2 11:42:24 1983 Date-Received: Sun, 6-Nov-83 09:46:26 EST References: watmath.6048 <969@utah-gr.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 15 In USG UNIX, "login" is no longer a real command (it lives in /etc) and the shell does not recognize it as a special command. This may have been done for the reasons mentioned; i.e., it monkeys with the who table entry. The "su" command in USG UNIX has an option to act like what you usually want when you do a "login" command; i.e., it forks off a new shell and runs it with argv[0] == "-su", so it thinks it's a login shell and runs /etc/profile and the user's .profile. It does not, however, change the LOGNAME environment variable (serves the same function as USER), which makes it a pain to use "su" to read the mail sent to pseudo-users like "adm" without having to log in as "adm" (or worse, pseudo-users like "uucp" who don't have a normal login shell). Of course, since USG "mail" has a forwarding facility you're probably supposed to forward their mail to a real person and not use "su" for this. Guy Harris {seismo,inhp4,allegra}!rlgvax!guy