From 887d4f6d94e0b7d06b9c13bb1721bc2568aca648 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Mon, 14 Feb 2022 09:09:14 -0500 Subject: [PATCH] Extend debug info --- home/lib/login_functions.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 0ff4e86..d5bd5dd 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -8,6 +8,7 @@ p() { BEGIN {_s = tolower(_s)} /^[a-zA-Z]/ && tolower($1) ~ _s && NF >= 2 { + n++ s = $1 p = $NF if (NF == 2) { @@ -20,7 +21,15 @@ p() { e = $2 u = $3 } # TODO What would NF > 4 mean? - printf("s:\"%s\", e:\"%s\", u:\"%s\"\n", s, e, u) > "/dev/stderr" + + printf("%d [O] s:\"%s\", e:\"%s\", u:\"%s\"\n", n, s, e, u) > "/dev/stderr" + if (match(u, "@")) { + tmp = e + e = u + u = tmp + printf("%d [C] s:\"%s\", e:\"%s\", u:\"%s\"\n", n, s, e, u) > "/dev/stderr" + } + printf "%s", p # XXX Intentionally avoiding newline in the result. } ' \ -- 2.20.1