Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

du uses tabs as column separators, not spaces! go go parameter expansion

  • Loading branch information...
commit 0fbbe1fbf789988fbc50de992827e6af7afa231e 1 parent 977cf79
@falconindy authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 squashfu
View
11 squashfu
@@ -317,11 +317,12 @@ action_report () {
printf "%30s\r" ".: Loading :." >&2
IFS=$'\n' read -r -d $'\0' -a data < <(du -csh . * 2>/dev/null | sort -n -k2)
for d in "${data[@]}"; do
- local bin=($(awk '{ print $2,$1 }' <<< $d))
- case ${bin[0]} in
- 'total') total=${bin[1]}; continue ;;
- '.') DATA[0]=${bin[1]} ;;
- *) DATA[${bin[0]}]=${bin[1]} ;;
+ local bin=${d#*[[:space:]]}
+ local size=${d%[[:space:]]*}
+ case ${bin} in
+ 'total') total=$size; continue ;;
+ '.') DATA[0]=$size ;;
+ *) DATA[${bin}]=$size ;;
esac
done
Please sign in to comment.
Something went wrong with that request. Please try again.