Tuesday
3
Feb 2009

Sum all numbers in a file

(11:06 am) Tags: [Software, Why I like..., How do I..., Sysadmin]

You HAVE to love the elegance of unix and the utilities contained therein:

awk '{ sum += $1; } END { print sum; }'

Popularity: 46%

Comments: (3)