cheat awk: sum integers from a file or stdin
This commit is contained in:
1 parent
6990807010
commit
bcdc3c7f23
1 file changed
+2
@@ -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}'
|
||||
Reference in new issue
Block a user