![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| user logged on any server | NIMISH AGARWAL | UNIX and Linux Applications | 3 | 09-28-2007 07:26 AM |
| know who logged and logged out with their timings | vkandati | UNIX for Dummies Questions & Answers | 3 | 03-09-2005 06:04 AM |
| user logged on? | provo | Shell Programming and Scripting | 1 | 12-08-2001 12:25 PM |
| Is user logged on?? | provo | UNIX for Dummies Questions & Answers | 1 | 12-07-2001 01:41 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
script on user who logged in????
writing a script that will check every 5 seconds whether a particular user has
logged into the system Code:
# Determine if someone is logged on # Version 4.0 if [ “$#” ne 1 ] then echo “ Incorrect number of arguments” echo “Usage: $ ison4 <user>” else user=“$1” if who | grep “$user” > /dev/null then echo “$user is logged on” else echo “$user is not logged on” fi fi Last edited by Yogesh Sawant; 04-30-2008 at 02:27 AM. Reason: added code tags |
| Forum Sponsor | ||
|
|
|
|||
|
I don't see the loop and the "sleep 5" but as the body of that missing loop, this looks okay (though mind-numbingly verbose -- I guess you want to take out the "is not" case once you have made sure it works correctly).
|