User Tools

Site Tools


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}'
bash/calculation.txt · Last modified: 2015/04/28 08:12 by warnaud