]> git.plutz.net Git - serve0/commitdiff
improved pipeline flow in category listing
authorPaul Hänsch <paul@plutz.net>
Fri, 24 Sep 2021 10:19:14 +0000 (12:19 +0200)
committerPaul Hänsch <paul@plutz.net>
Fri, 24 Sep 2021 10:19:14 +0000 (12:19 +0200)
widgets.sh

index f825c12c8213678ab4bb74caab25a61cba128bea..6af562e84cb4f4e7fa6e3d703472e8df144737db 100644 (file)
@@ -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 \