To Display On The Screen The "Sorted" Output of "Who" command Along With Total No. Of Users Gain Infiniti

To Display On The Screen The "Sorted" Output of "Who" command Along With Total No. Of Users


who | sort | tee  outputFile
echo -n "The Total Number of Logged in users = "
wc -l < outputFile


OUTPUT:-

#!/bin/bash
#root@slack-linunx:~/scripts# ./whoSorted.sh
#root     pts/0        2009-10-25 10:06 (192.168.220.1)
#root     tty1         2009-10-25 10:06
#The Total Number of Logged in users = 2
#root@slack-linunx:~/scripts#

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 

Design By Manish and Ranjan