#!/usr/bin/perl #use strict; #use warnings; # jac, August 2003 # study # study user root # study command grep # study system # study user root command ls #$what = shift; # user command system #$what2 = shift; #my (%a,$t,$c); open F, "$ENV{HOME}/.bash_history"; while () { m/^[a-z]+/ && $a{$&}++ && $t++ } for (sort {$a{$a} <=> $a{$b}} keys %a) { $c++; print sprintf"$_\t$a{$_}\t%2.2f%\n",($a{$_}*100/$t) }