From 167260211ad6dec127eec878e75b52362f9ed1f6 Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Sun, 7 Jun 2020 19:16:55 -0400 Subject: [PATCH] Found a nice lil trick --- scripts/ram_info.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ram_info.sh b/scripts/ram_info.sh index da5bf76..ed5c1bd 100755 --- a/scripts/ram_info.sh +++ b/scripts/ram_info.sh @@ -19,7 +19,7 @@ get_percent() Darwin) # percent=$(ps -A -o %mem | awk '{mem += $1} END {print mem}') used_mem=$(top -l 1 -s 0 | grep PhysMem | awk '{mem += $2} END {print mem}') - total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{mem += $2} END {print mem}') + total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{print $2 $3}' | sed 's/used//g') echo $used_mem/$total_mem\G\B ;;