ls | grep -P "$1" | awk '{ x += $5 } END { print "total bytes:" x }'
This code is returning 0 using “[0-9]” as reg expr, in current folder there are 2 files named: “1” and “6”, each one with size of 138bytes.
Anyone could help me to find the problem?
You’re just missing the
-loption tols.