Fixed reviews

This commit is contained in:
Ethan Edwards 2020-06-13 21:42:27 -04:00
parent e41cabee1c
commit ac2f789ff4

View file

@ -18,9 +18,14 @@ get_percent()
Darwin) Darwin)
# percent=$(ps -A -o %mem | awk '{mem += $1} END {print mem}') # percent=$(ps -A -o %mem | awk '{mem += $1} END {print mem}')
used_mem=$(top -l 1 -s 0 | grep PhysMem | awk '{print $2 $3}' | sed 's/used//g') used_mem=$(vm_stat | grep -i "Pages active:" | sed 's/\.//g' | awk '{printf "%d", $3*4096/1024/1024}')
total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{print $2 $3}' | sed 's/used//g') total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{print $2 $3}')
echo $used_mem/$total_mem if (( $used_mem < 1024 )); then
echo $used_mem\M\B/$total_mem
else
memory=$(($used_mem / 1024))
echo $memory\G\B/$total_mem
fi
;; ;;
CYGWIN*|MINGW32*|MSYS*|MINGW*) CYGWIN*|MINGW32*|MSYS*|MINGW*)