![]() |
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 |
| tr explanation please | convenientstore | Shell Programming and Scripting | 1 | 05-30-2007 11:42 PM |
| Explanation of running this script | sendhilmani | Shell Programming and Scripting | 2 | 03-21-2006 03:07 AM |
| Script explanation | sickboy | Shell Programming and Scripting | 8 | 06-13-2005 02:25 PM |
| AWK explanation | penfold | Shell Programming and Scripting | 2 | 04-05-2005 09:46 PM |
| any explanation for thsi shell script behaviour | xiamin | Shell Programming and Scripting | 9 | 11-09-2001 01:13 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need explanation of script
Hi
All, Can anybody explain what this script is doing? #!/bin/sh who | cut -d " " -f1 | sort -u > userlist1 while true ; do sleep 60 who | cut -d" " -f1 | sort -u >userlist2 for username in `cat userlist1` ; do if ! grep "^$username$" userlist2 > /dev/null ; then echo "$username has logged out" fi done for username in `cat userlist2` ; do if ! grep "^$username$" userlist1>/dev/null; then echo "$username hass logged in" done mv userlist2 userlist1; done Thanks, Vishal |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|