home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02f10c8
)
Use total available rather than total in use
author
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 3 Nov 2020 01:06:22 +0000
(20:06 -0500)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 3 Nov 2020 01:06:22 +0000
(20:06 -0500)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
2577531
..
c4a583a
100644
(file)
--- 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
}
This page took
0.030947 seconds
and
4
git commands to generate.