From 1bca06c0db776cfe9113f5c51aa4531cc1c35d84 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Mon, 22 Oct 2018 22:08:34 +1100 Subject: [PATCH] get_memory: fix awk for vm_stat on macOS --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 400db8ff..f1442fd6 100755 --- a/neofetch +++ b/neofetch @@ -2220,9 +2220,9 @@ get_memory() { "Mac OS X" | "iPhone OS") mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))" - mem_wired="$(vm_stat | awk '/wired/ { print $4 }')" - mem_active="$(vm_stat | awk '/active / { printf $3 }')" - mem_compressed="$(vm_stat | awk '/occupied/ { printf $5 }')" + mem_wired="$(vm_stat | awk '/ wired/ { print $4 }')" + mem_active="$(vm_stat | awk '/ active/ { printf $3 }')" + mem_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')" mem_compressed="${mem_compressed:-0}" mem_used="$(((${mem_wired//.} + ${mem_active//.} + ${mem_compressed//.}) * 4 / 1024))" ;;