while read perms links owner group size month day time file
do
printf "%10d %s\n" "$size" "$file"
totalsize=$(( ${totalsize:=0} + ${size:-0} ))
done < <(ls -l *)
выводит: 0 0
и если echo ${totalsize-unset}
то опять же:
0
while read perms links owner group size month day time file
do
printf "%10d %s\n" "$size" "$file"
totalsize=$(( ${totalsize:=0} + ${size:-0} ))
done < <(ls -l *)
выводит: 0 0
и если echo ${totalsize-unset}
то опять же:
0