Difference between revisions of "bash sum series of numbers with awk"

From thelinuxwiki
Jump to: navigation, search
(Created page with "for a series of numbers on different lines of a file or on different lines of stdin, awk will do... awk '{s+=$1} END {print s}' category:scripting category:awk")
 
 

Latest revision as of 14:38, 18 January 2014

for a series of numbers on different lines of a file

or

on different lines of stdin, awk will do...

awk '{s+=$1} END {print s}'