Your Ad Here

Minggu, 29 Juni 2014

Unix Tip: AWK THE STATS

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3428 - June 29, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


AWK THE STATS


AWK script for getting
statistics.

The script gives the
statistics of the default
shell set for the users.

i.e. Number of users using
csh,ksh or sh

$cat stat_demo.awk
#start here
BEGIN{
FS=":"
#seperator is set to :
}
{
#$7, is 7 field in passwd file
stat_array[$7]=stat_array[$7]+1;
}
END{
print "Login-Shell Count" ;
for (i in stat_array) print i, stat_array[i]
#Displays statistics
}

Tidak ada komentar:

Posting Komentar

Your Ad Here
Free Automatic Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink