diff --git a/free-gigs b/free-gigs index 8d8a2d9..dadf7c4 100755 --- a/free-gigs +++ b/free-gigs @@ -19,10 +19,11 @@ if free_bytes=$(stat -f --format="%a*%S" "$target" 2>/dev/null); then : elif free_bytes=$(stat -f "%a*%S" "$target" 2>/dev/null); then # BSD/macOS stat + # XXX untested : else # BusyBox stat fallback - free_bytes=$(stat -f "$target" | awk '/Block size:/ {bs=$3} /Available:/ {av=$2} END {print av*bs}') + free_bytes=$(stat -f -c "%a*%S" "$target") fi free_gb=$((free_bytes / factor / factor / factor))