3 ms·
> sum == SUM() I don't think so. From sum(1): > sum - checksum and count the blocks in a file $ seq 1 3 | sum 26670 1 I guess 26670 is the checksum
by jolmg 7y ago
> sum == SUM()
I don't think so. From sum(1):
> sum - checksum and count the blocks in a file
$ seq 1 3 | sum
26670 1
I guess 26670 is the checksum and the 6 bytes in the output of seq fit into 1 block...
For a SUM() equivalent, I can't think of anything shorter or more convenient than the following while using only standard utils:
$ seq 1 3 | awk '{a+=$1}END{print a}'
6