#!/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}'
accumulate a column and print the total