hello im looking for short way to sum numbers from stdout the way i found to do it is to long for me i wander if there is shorter way to do it
ok it 2 stage action
this will make the list of number in to file sum.txt
grep -c include *.c | awk '{l=split($0,a,":");print a[2];}' > sum.txt
this will print the sum from the file
awk 'BEGIN {total=0} {total += $1} END {print total}' sum.txt
is there any way to make this action shorter?