Forcing actions at login
Rich Salz
rsalz at bbn.com
Sat Jan 19 07:26:41 AEST 1991
Cshell
cmp -s /etc/motd $HOME/.hushlogin
if ( $status ) tee $HOME/.hushlogin </etc/motd
Real shell
cmp -s /etc/motd $HOME/.hushlogin || tee $HOME/.hushlogin </etc/motd
This has tickled bugs on some shells, including early Bash, I think,
so you have to use the more ugly:
if cmp -s /etc/motd $HOME/.hushlogin ; then
:
else
tee $HOME/.hushlogin </etc/motd
fi
--
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.
More information about the Comp.unix.admin
mailing list