perl -nE"/: / and $c+= (split/: /)[0]; if( eof(ARGV) ){ say qq[SUM.$ARV =$c]; $c=0 }" tmp_*