mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-23 06:02:12 +01:00
cheat awk: sum integers from a file or stdin
This commit is contained in:
parent
6990807010
commit
bcdc3c7f23
1 changed files with 2 additions and 0 deletions
2
cheatsheets/awk
Normal file
2
cheatsheets/awk
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# sum integers from a file or stdin, one integer per line:
|
||||||
|
printf '1\n2\n3\n' | awk '{ sum += $1} END {print sum}'
|
Loading…
Reference in a new issue