X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Flib%2Flogin_functions.sh;h=c4a583ab7f0727635442ef2281f0a7d7be6bcbb1;hb=c5f3db4310cb09059b824d2ba7c68883c174bb89;hp=25775314d1c6b8d2ce71a0f43b26fd26c46adc55;hpb=02f10c8b6438555ddc637e5f6bda840e0b6f06ae;p=khome.git diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 2577531..c4a583a 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -514,13 +514,12 @@ motd() { printf '%smem by proc\n' "$indent_unit" ps -eo rss,cmd \ - | awk ' + | 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] - total += rss by_proc[proc] += rss }