Hi, guy!
On Sun, Mar 26, 2000 at 02:26:14AM +0200, you wrote the following:
> > HI everybody,
> > Can anybody tell me how can i get the usrid of the user when new user log
> > in to the linux system.. and how can i set the messege for him for first
> > time only. The messenge should not come when he login second time.
> > thanks..
>
> one simple way of showing a one-time message, is setting the user's
> '.cshrc' run a system-wide script, that maintains a small database of
> users who've already seen the message. this script will show the mesasge
> only if the user is not already in that database, and then update the
> database. this is ofcourse a bit risky, since the database needs to be
> world-writeable (as the script runs under the ID of this new user).
In Debian there's a small package called sysnews which accomplishes
this, although slightly differently -- instead of maintaining a
database, it touches a file called $HOME/.news_time after showing the
messages, and doesn't display messages older than the date of that
file upon execution. Just put it in /etc/csh.cshrc and /etc/profile
and then put files with messages in /var/news whenever you need.
I suppose the program is available for other distributions too.
--
Alex Shnitman | http://www.debian.org
[EMAIL PROTECTED], [EMAIL PROTECTED] +-----------------------
http://alexsh.hectic.net UIN 188956 PGP key on web page
E1 F2 7B 6C A0 31 80 28 63 B8 02 BA 65 C7 8B BA
"The number of Unix installations has grown to 10, with more expected."
-- The Unix Programmer's Manual, 2nd Edition, June, 1972
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]