Operating System - HP-UX
1833640 Members
4035 Online
110062 Solutions
New Discussion

users logging on a nerwork

 
mo jaber
Occasional Contributor

users logging on a nerwork

this script checks every 10 sec if one or more users are logged on. the script reports when all the users ( in a specific group) are log on togather, and then stops.
first i want to know if it works??
second how to make it better?
* the script is in tcsh.
please contact me as soon as possible!

#!/bin/tcsh

if (!$#argv) then
echo error
exit 1
endif

set w= (`who | grep #argv[*]`)
if ($#w==$argv[*]) then
echo $argv[*] log on

else
echo $argv[*] not log on
endif
sleep 10
exit