From 7fe62e584f8c37b0db520d3cf17aa0c9af2b1959 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Sun, 1 Nov 2020 16:29:55 -0500 Subject: [PATCH] Removing possible trailing colon --- home/lib/login_functions.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.20.1