From 26739e9ae6b8da3e51e999ef25214e9c8c6a25aa Mon Sep 17 00:00:00 2001 From: Teddysun Date: Tue, 10 Nov 2020 19:40:00 +0900 Subject: [PATCH] Fixed issue #74 Signed-off-by: Teddysun --- bench.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bench.sh b/bench.sh index 40c0c27..0ef1b03 100644 --- a/bench.sh +++ b/bench.sh @@ -186,15 +186,15 @@ cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed ' cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo ) freq=$( awk -F'[ :]' '/cpu MHz/ {print $4;exit}' /proc/cpuinfo ) ccache=$( awk -F: '/cache size/ {cache=$2} END {print cache}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' ) -tram=$( free -m | awk '/Mem/ {print $2}' ) -uram=$( free -m | awk '/Mem/ {print $3}' ) -swap=$( free -m | awk '/Swap/ {print $2}' ) -uswap=$( free -m | awk '/Swap/ {print $3}' ) +tram=$( LANG=C; free -m | awk '/Mem/ {print $2}' ) +uram=$( LANG=C; free -m | awk '/Mem/ {print $3}' ) +swap=$( LANG=C; free -m | awk '/Swap/ {print $2}' ) +uswap=$( LANG=C; free -m | awk '/Swap/ {print $3}' ) up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60} {printf("%d days, %d hour %d min\n",a,b,c)}' /proc/uptime ) if _exists "w"; then - load=$( w | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' ) + load=$( LANG=C; w | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' ) elif _exists "uptime"; then - load=$( uptime | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' ) + load=$( LANG=C; uptime | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' ) fi opsy=$( get_opsy ) arch=$( uname -m )