Rettemp.pl

From Yefu's notes
Jump to: navigation, search
% cat `which rettemp.pl`
#!/usr/bin/perl -w

use strict;

opendir (my $dir, '.') or die('Can I die on $!?');
my @dirs =  readdir($dir);
closedir $dir;

foreach my $dir  (sort {$a <=> $b}  @dirs)
{
 my $cmd = "cat $dir |grep average | head -n 7 | awk \'{print \$2}\' | sort | tail -n 4 |numaverage";
 #print "$cmd \n";
 my $avg = `$cmd`;

 #print "$dir\t$avg";
 print "$avg";
}