software:cli:bash:calculation
Sum values of all lines from a file/output
awk '{s+=$1} END {print s}' mydatafile
Can be used also with |
grep "whatever" mydatafile | cut | … | awk '{s+=$1} END {print s}'
software/cli/bash/calculation.txt · Last modified: 2021/12/29 21:09 by warnaud