cheat-fork-echo/cheatsheets/awk
2013-08-27 14:06:15 +03:00

2 lines
115 B
Text

# sum integers from a file or stdin, one integer per line:
printf '1\n2\n3\n' | awk '{ sum += $1} END {print sum}'