X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=widgets.sh;h=6af562e84cb4f4e7fa6e3d703472e8df144737db;hb=4c469ef53af984583e8ccb4b29d051c52bba8172;hp=35b8b70ed349a9414e020e1789df3dc4176aa301;hpb=f307cfa12e5dbdd445ca787011eefbefd5c47dc5;p=serve0 diff --git a/widgets.sh b/widgets.sh index 35b8b70..6af562e 100644 --- a/widgets.sh +++ b/widgets.sh @@ -16,17 +16,17 @@ if [ ! -s "$c_tags" -o ! -s "$c_tagcategories" ] \ then w_tags="$( cn=1 find "$_DATA/" -path '*/.index/meta' -print0 \ - | xargs -r0 sed -r ' + | xargs -0 -r sed -E ' s;^.*\t.*\t.*\ttags=(.*)\tcomment=.*\t.*\r$;\1;; - s;,;\n;g;'"$UNSTRING" \ + s;,;\n;g;' \ | { 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 \