The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-03-2007
ladytwo ladytwo is offline
Registered User
 

Join Date: Oct 2007
Posts: 3
look for users to be looged on or off

what am i doing wrong here's code. i have a file that has names of users and i want to know when they log on and off.

while true
do
for X in "friends1"
do
if who | grep "$X"
then
echo "$X is logged in"
else
sleep 5
fi

echo who > on
if [ $X -ne on]
then
echo "$X is logged off"
else
else sleep 5
fi
done
done
Reply With Quote
Forum Sponsor