]> git.plutz.net Git - serve0/commitdiff
call sed via xargs, which seems to be quicker than find -exec
authorPaul Hänsch <paul@plutz.net>
Mon, 13 Sep 2021 17:54:31 +0000 (19:54 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 13 Sep 2021 17:54:31 +0000 (19:54 +0200)
widgets.sh

index f79d457303b672eeb0ea35ab00478d531dfba131..f825c12c8213678ab4bb74caab25a61cba128bea 100644 (file)
@@ -15,10 +15,10 @@ if [ ! -s "$c_tags" -o ! -s "$c_tagcategories" ] \
    || [ "$(find "$_DATA/" -path '*/.index/meta' -newer "$c_tags")" ]
   then
   w_tags="$( cn=1
-    find "$_DATA/" -path '*/.index/meta' -exec \
-      sed -E 's;^.*\t.*\t.*\ttags=(.*)\tcomment=.*\t.*\r$;\1;;
-              s;,;\n;g;' \
-      '{}' + \
+    find "$_DATA/" -path '*/.index/meta' -print0 \
+    | 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