summaryrefslogtreecommitdiff
path: root/tests/du/2g.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/du/2g.sh')
-rwxr-xr-xtests/du/2g.sh5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/du/2g.sh b/tests/du/2g.sh
index cfd1fc464..f766d4d9d 100755
--- a/tests/du/2g.sh
+++ b/tests/du/2g.sh
@@ -27,10 +27,7 @@ very_expensive_
# Get number of free kilobytes on current partition, so we can
# skip this test if there is insufficient free space.
-
-# This technique relies on the fact that the 'Available' kilobyte
-# count is the number just before the one with a trailing '%'.
-free_kb=$(df -kP .|tail -1|sed 's/ [0-9][0-9]*%.*//;s/ *$//;s/.* //')
+free_kb=$(df -k --output=avail . | tail -n1)
case "$free_kb" in
[0-9]*) ;;
*) skip_ "invalid size from df: $free_kb";;