]> git.plutz.net Git - serve0/commitdiff
quicker name prefix assignment
authorPaul Hänsch <paul@plutz.net>
Tue, 22 Feb 2022 15:23:42 +0000 (16:23 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 22 Feb 2022 15:23:42 +0000 (16:23 +0100)
db_meta.sh

index 588e62d30b677fc1d3318bdba44d0ca24e6c12f3..ffe7c4ddd3a0f79b9584cee07f4ccd8076691597 100755 (executable)
@@ -155,12 +155,13 @@ list_meta(){
     pfx="$(STRING "${pfx#/}")"
     [ "$pfx" = '\' ] && pfx='' || pfx="${pfx}/"
 
-    dbmeta_autogroup "$meta" \
-    | while read -r LENGTH WIDTH HEIGHT TAGS COMMENT NAME GROUP; do
-      printf '%i       %i      %i      %s      %s      %s%s    %s\n' \
-             $LENGTH $WIDTH $HEIGHT "${TAGS}" "${COMMENT}" \
-             "${pfx}" "${NAME}" "${GROUP}"
-    done
+    { printf '%s\n' "$pfx"
+      dbmeta_autogroup "$meta"
+    } | sed -E '
+      1{ h; b; }
+      G;
+      s;^([^\t]+       [^\t]+  [^\t]+  [^\t]+  [^\t]+  )([^\n]+)\n(.*)$;\1\3\2;
+    '
   done
 }