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#
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