Next | Welcome to my ~/bin | 7 |
Larry Wall said (in 1991):
In article <l8bHn=?l3@cs.psu.edu> flee@cs.psu.edu (Felix Lee) writes:
: awk is much better than perl at one-line summations:
: awk '{t += $1} END {print t}'
Hey, I had to let awk be better at something... :-)
But I did get awfully tired of writing this over and over
awk '{t += $1} END {print t}' is a lot to type
One day, I wrote addup
#!/usr/local/bin/perl -na $total += $F[0];
END {print $total, "\n" }
Next | Menu | Copyright © 2005 M. J. Dominus |