Pages

Tuesday, March 19, 2013

Write a script to check the given user is logged in or not?


$vi delete.sh
echo “enter login name:”
read lname
if who | grep $lname > /dev/null
then
echo “user is online”
else
echo “user is offline “
fi
:wq

No comments:

Post a Comment