Skip to content

Instantly share code, notes, and snippets.

@matiskay
Created January 5, 2012 03:44
Show Gist options
  • Save matiskay/1563606 to your computer and use it in GitHub Desktop.
Save matiskay/1563606 to your computer and use it in GitHub Desktop.
How many times do you use your commands
#!/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