From 146d3940207540bd100424a96b75803ad396e0fb Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Tue, 12 Dec 2017 13:32:26 +0100 Subject: [PATCH] install.sh: Fix use of "du" to always use -k Fixes the case where on some systems "du" prints the summary with the unit (K) appended, causing an error like the following: ./install.sh: 213: [: Illegal number: 6593020K --- shell/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/install.sh b/shell/install.sh index 9b80a8de1d8..3fdcbc7768d 100755 --- a/shell/install.sh +++ b/shell/install.sh @@ -209,7 +209,7 @@ if [ -d "$OPAMROOT" ]; then echo "Please move it away or run with --no-backup" fi FREE=$(df -k "$OPAMROOT" | awk 'NR>1 {print $4}') - NEEDED=$(du -s "$OPAMROOT" | awk '{print $1}') + NEEDED=$(du -sk "$OPAMROOT" | awk '{print $1}') if ! [ $NEEDED -lt $FREE ]; then echo "Error: not enough free space to backup. You can retry with --no-backup," echo "--fresh, or remove '$OPAMROOT'"