From fbcc6a552a68b5ae05403097246d8b44f88ed4b5 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Wed, 6 Oct 2021 17:35:38 -0400 Subject: [PATCH] Simplify proc name grabbing --- home/lib/login_functions.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 894ec7f..59989af 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -536,13 +536,11 @@ status() { echo printf '%smem by proc\n' "$indent_unit" - ps -eo rss,cmd \ + ps -eo rss,comm \ | awk -v total="$(free | awk '$1 == "Mem:" {print $2; exit}')" ' NR > 1 { rss = $1 - cmd = $2 - n = split(cmd, path, "/") # _may_ be a path - proc = path[n] + proc = $2 by_proc[proc] += rss } -- 2.20.1