#!/bin/bash
while read perms links owner group size year month day time file
do printf "%10d %s\n" "$size" "$file"
totalsize=$(( ${totalsize:=0}+${size:-0} ))
done < <(ls -l *)
echo ${totalsize-unset}
#!/bin/bash
while read perms links owner group size year month day time file
do printf "%10d %s\n" "$size" "$file"
totalsize=$(( ${totalsize:=0}+${size:-0} ))
done < <(ls -l *)
echo ${totalsize-unset}