postheadericon Write a shell script to check whether the named user is currently logged in or not.


File Name : ex16.sh


clear
echo "Enter user name : \c"
read unm
unm1=$(who | cut -d " " -f 1)
if [ "$unm" = "$unm1" ]
then
            echo " [ $unm ] is already Login"
else
            echo " [ $unm ] is not Login"
fi


0 comments:

Blog Archive

Total Pageviews

© BipinRupadiya.com. Powered by Blogger.