make sure tagline is non-zero and other minor awk tweaks - annna - Annna the ni… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 14fd160e2d5b4e9246327648bd295e31ceaec5fd | |
parent 99c08878d8c6c5460b7615776bde2bda054ca444 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 13 Nov 2020 16:48:49 +0100 | |
make sure tagline is non-zero and other minor awk tweaks | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M annna-start-services | 21 +++++++++------------ | |
1 file changed, 9 insertions(+), 12 deletions(-) | |
--- | |
diff --git a/annna-start-services b/annna-start-services | |
@@ -658,24 +658,21 @@ annna_common() { | |
done | |
else | |
printf '%s' "$text" | awk -v taglimit="$printnhashtags" ' | |
- { | |
- if ($0 ~ /#/ && $0 !~ /#nospoil/) { | |
- for (i = 1; i <= NF; i++) { | |
- if (match($i, /#[A-z0-9\+-]*/)) { | |
- tags[j++] = substr($i, RSTART,… | |
- } | |
- } | |
- } | |
+ $0 ~ /#/ && $0 !~ /#nospoil/ { | |
+ for (i = 1; i <= NF; i++) | |
+ if (match($i, /#[A-z0-9\+-]*/)) | |
+ tags[j++] = substr($i, RSTART, RLENGTH) | |
} | |
END { | |
- for (tag in tags) { | |
+ for (tag in tags) | |
if (k++ < taglimit) | |
print tags[tag] | |
- } | |
}' | while read -r tag; | |
do | |
- tagline="$(grep "${tag} " "${hashtagfile}")" | |
- annna-say -c "${channel}" "${tagline% *}: ${tagline#* … | |
+ if tagline="$(grep "${tag} " "${hashtagfile}")"; | |
+ then | |
+ annna-say -c "${channel}" "${tagline% *}: ${ta… | |
+ fi | |
done | |
fi | |