Skip to content

Instantly share code, notes, and snippets.

@pokle
Created October 10, 2015 08:22
Show Gist options
  • Save pokle/65b98dcee339c186cd87 to your computer and use it in GitHub Desktop.
Save pokle/65b98dcee339c186cd87 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
#
# Major device number counts of the home files at http://sylab-srv.cs.fiu.edu/doku.php?id=projects:iodedup:start
#
# run like this: perl counts.pl homes-*
use strict;
my %count = ();
# Collect
while (<>) {
# Split the line by spaces
my @columns = split ' ';
# Tally a count by column 6: major device number
$count{$columns[6]}++;
}
# Print out the counts
while( my( $key, $value ) = each %count ){
print "$key: $value\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment