bash sum series of numbers with awk

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