On Thu, 23 Mar 2000, Bhupesh Kokate wrote:

> 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).

another method is put a script in the user's directory that's run via its
'.cshrc', and then immediatly erased. this script will print out the
welcome message.

one other option - there are packages on the net that do similar things.
check out on freshmeat.net 

as to finding the ID of the user - this depends on what you want to do
with it. if this is just to personalize the message, use the '$USER'
environment variable. if this is for other purposes, and you're afraid
that users might abuse this, then just explain what you need it for.

hope this helps,
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy


=================================================================
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]

Reply via email to