Created
January 5, 2012 03:44
-
-
Save matiskay/1563606 to your computer and use it in GitHub Desktop.
How many times do you use your commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my %counts = () ; | |
while (my $cmd = <STDIN>) { | |
chomp $cmd ; | |
if (!$counts{$cmd}) { | |
$counts{$cmd} = 1 ; | |
} else { | |
$counts{$cmd}++ ; | |
} | |
} | |
foreach $k (keys %counts) { | |
my $count = $counts{$k} ; | |
print "$count $k\n" ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment