Forcing actions at login

John F Haugh II jfh at rpp386.cactus.org
Mon Jan 14 07:18:52 AEST 1991


In article <1991Jan10.191546.268 at am.sublink.org> alex at am.sublink.org (Alex Martelli) writes:
>Just kludge up a way to disable motd-checking - simplest scheme I can
>think of, offhand, is to add something like:
>	egrep "^$LOGNAME:.*NOMOTD" /etc/passwd >/dev/null && exit
>just before the cat /etc/motd in /etc/profile, then add the NOMOTD
>keyword somewhere in the /etc/passwd line of the pseudo-user (e.g. in
>the gcos field, or just use it as a part of the filename of the pseudo
>shell script for the pseudo-user).

If you are going to "Just kludge up a way" you might as well use the
way that exists already.

	if [ ! -f $HOME/.hushlogin ]; then
		cat /etc/motd
	fi

This is how BSD login handles the problem.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org
"While you are here, your wives and girlfriends are dating handsome American
 movie and TV stars. Stars like Tom Selleck, Bruce Willis, and Bart Simpson."



More information about the Comp.unix.admin mailing list