From 3b9f0e2bcc14201a61aee1420a00676637d81e0a Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sat, 5 Dec 2015 23:04:52 +0800 Subject: [PATCH] Fix get Memory & Swap --- bench.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench.sh b/bench.sh index d875635..7babcc3 100644 --- a/bench.sh +++ b/bench.sh @@ -9,8 +9,8 @@ cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' ) cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo ) freq=$( awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//' ) -tram=$( free -m | awk 'NR==2 {print $2}' ) -swap=$( free -m | awk 'NR==4 {print $2}' ) +tram=$( free -m | awk '/Mem/ {print $2}' ) +swap=$( free -m | awk '/Swap/ {print $2}' ) up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime ) opsy=$( cat /etc/issue.net | awk 'NR==1 {print}' ) arch=$( uname -m )