From: Siraaj Khandkar Date: Sun, 1 Nov 2020 21:29:55 +0000 (-0500) Subject: Removing possible trailing colon X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=7fe62e584f8c37b0db520d3cf17aa0c9af2b1959;p=khome.git Removing possible trailing colon --- diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 01ada21..9f06a6b 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -542,7 +542,12 @@ motd() { echo echo 'Loggers' - awk '{split($5, prog, "["); print prog[1]}' /var/log/syslog \ + awk ' + { + split($5, prog, "[") + sub(":$", "", prog[1]) # if there were no [], than : will is left behind + print prog[1] + }' /var/log/syslog \ | awk ' { n = split($1, path, "/") # prog may be in path form