bash sum series of numbers with awk

From thelinuxwiki
Revision as of 14:38, 18 January 2014 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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}'