![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| user logged on any server | NIMISH AGARWAL | UNIX and Linux Applications | 3 | 09-28-2007 10:26 AM |
| know who logged and logged out with their timings | vkandati | UNIX for Dummies Questions & Answers | 3 | 03-09-2005 10:04 AM |
| user logged on? | provo | Shell Programming and Scripting | 1 | 12-08-2001 04:25 PM |
| Is user logged on?? | provo | UNIX for Dummies Questions & Answers | 1 | 12-07-2001 05:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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 05:27 AM.. Reason: added code tags |
|
||||
|
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).
|
![]() |
| Bookmarks |
| Tags |
| shell script, watch |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|