I'm stuck at figuring out how to sum ls 5th column result with awk. If I add $bytesum+=... then the program obviously breaks.
Any ideas?
bytesum=0
for i in `cat fileextensions.txt | sort | uniq`
do
ls -Rl "$folder" | grep $i | awk '{bytesum+=$5}; {print $9 " " $5}'
done
echo $bytesum