From: Siraaj Khandkar Date: Mon, 2 Nov 2020 11:45:11 +0000 (-0500) Subject: Add process owners report to motd X-Git-Url: https://git.xandkar.net/?p=khome.git;a=commitdiff_plain;h=1c02c71424263761147345e5cb220879d76adc28 Add process owners report to motd --- diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 7635e5d..6b01d49 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -549,6 +549,26 @@ motd() { echo + echo 'Process owners' + ps -eo user \ + | awk ' + NR > 1 { + count_by_user[$1]++ + total++ + } + + END { + for (user in count_by_user) + print count_by_user[user], total, user + } + ' \ + | sort -n -k 1 -r \ + | bar_gauge -v num=1 -v ch_left=' ' -v ch_right=' ' -v ch_blank=' ' \ + | column -t \ + | indent "${indent_unit}" + + echo + echo 'Loggers' awk ' {