Saturday, January 06, 2007

UNIX tips for the day

1. How do you sum up a file containing numbers (one in each row)?

I keep forgetting there is a simple AWK command to do this...

[paddu@home ] cat <filename.txt> | awk '{sum = sum + $1}; END {print sum}'

Labels:

2 Comments:

Anonymous Anonymous said...

one of the best series of all times...

5:57 AM  
Anonymous Anonymous said...

sorry, wanted to comment on the Yes Minister post

5:59 AM  

Post a Comment

<< Home

JUST FOR KICKS