From: Siraaj Khandkar Date: Mon, 14 Feb 2022 14:09:14 +0000 (-0500) Subject: Extend debug info X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=887d4f6d94e0b7d06b9c13bb1721bc2568aca648;p=khome.git Extend debug info --- 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. } ' \