From 4c469ef53af984583e8ccb4b29d051c52bba8172 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 24 Sep 2021 12:19:14 +0200 Subject: [PATCH] improved pipeline flow in category listing --- widgets.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/widgets.sh b/widgets.sh index f825c12..6af562e 100644 --- a/widgets.sh +++ b/widgets.sh @@ -19,15 +19,14 @@ if [ ! -s "$c_tags" -o ! -s "$c_tagcategories" ] \ | xargs -0 -r sed -E ' s;^.*\t.*\t.*\ttags=(.*)\tcomment=.*\t.*\r$;\1;; s;,;\n;g;' \ - | UNSTRING \ | { sort; printf '\n'; } \ | while read -r tag; do - [ "$tag" = "$otag" ] \ - && cn=$((cn + 1)) \ - || { - printf "%i %s\n" "$cn" "$otag" + if [ "$tag" = "$otag" ]; then + cn=$((cn + 1)) + else + printf "%i %s\n" "$cn" "$(UNSTRING "$otag")" cn=1 - } + fi otag="$tag" done \ |sort -rn |cut -f2- |HTML \ -- 2.39.2