From 9c6b9ab33d521d80717978f9f7e3410cb439f6c7 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Thu, 2 Feb 2012 12:13:00 -0700 Subject: [PATCH] Use printf(%d) to avoid CentOS using floats. --- lib/bash/safeguards.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bash/safeguards.sh b/lib/bash/safeguards.sh index 91402bb6..edd9ed26 100644 --- a/lib/bash/safeguards.sh +++ b/lib/bash/safeguards.sh @@ -50,8 +50,8 @@ check_disk_space() { local bytes_margin="${4:-0}" # Real/actual bytes used and bytes free. - local used_bytes=$(cat "$file" | awk '/^\//{print $3 * 1024}'); - local free_bytes=$(cat "$file" | awk '/^\//{print $4 * 1024}'); + local used_bytes=$(cat "$file" | awk '/^\//{printf("%d",$3 * 1024)}'); + local free_bytes=$(cat "$file" | awk '/^\//{printf("%d",$4 * 1024)}'); local pct_used=$(cat "$file" | awk '/^\//{print $5}' | sed -e 's/%//g'); local pct_free=$((100 - $pct_used))