aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-06-11 14:43:39 -0400
committerDave Reisner <d@falconindy.com>2010-06-11 14:43:39 -0400
commit0fbbe1fbf789988fbc50de992827e6af7afa231e (patch)
tree5618b397992d45ab237ebcd24e5ef82286ac8eff
parent977cf7902de607f612cd86c6707eb52aa5759cb1 (diff)
downloadsquashfu-0fbbe1fbf789988fbc50de992827e6af7afa231e.tar.gz
du uses tabs as column separators, not spaces! go go parameter expansion
-rwxr-xr-xsquashfu11
1 files changed, 6 insertions, 5 deletions
diff --git a/squashfu b/squashfu
index 7b561e0..7852038 100755
--- a/squashfu
+++ b/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