CHECK
HOW MANY TIMES THE SPECIFIC USER HAS LOGIN:
echo "To count the user login"
read username
who > x.txt
c=`grep $username x.txt | wc -l`
echo "The user has logged $c
times"
OUTPUT:
[@localhost ~]$ sh userlog.sh
To count the user login
27324
The user has logged 1 times
[@localhost ~]$
No comments:
Post a Comment
Thanks for your valuable comments