Text Processing13 / 18
Up next

awk running sum

#!/usr/bin/env bash

# add up column 1, print the total in the END block
printf '%s\n' 10 20 30 |
  awk '{sum += $1} END {print sum}' 
What you're solving

accumulate a column and print the total