Permalink
Browse files

fix displaing disk-usage on bash 3.2/osx, fix #1144

  • Loading branch information...
1 parent d4ceafb commit 6a03e98c4daa55cdfb1dfa3b72e1006d9fc2b616 @mpapis mpapis committed Sep 27, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 scripts/disk-usage
View
@@ -21,7 +21,8 @@ disk_usage()
printf "%${length}s" "${name} Usage: "
if [[ -n "$directory" && -d "$directory" && "$directory" != "/" ]]
then
- _pre="$(du -hs "$@" "${directory}/")"
+ # echo needed to clean spaces (different systems displays this differently)
+ _pre="$( echo $( du -hs "$@" "${directory}/" ) )"
echo ${_pre%% *}
else
echo "0B"

0 comments on commit 6a03e98

Please sign in to comment.