I have created this program to see if a user is logged on and it checks every minute.
if [ "$#" -ne 1 ] then echo "Usage: mon user" exit 1 fi user="$1" until who | grep "^$user " > /dev/null do sleep 60 done echo "$user has logged on"
But my question is how can I modify this program to see if a user has logged off instead of logging in?
Thanks for any help provided! Much appreciated.