From: Paul Hänsch Date: Tue, 22 Feb 2022 15:23:42 +0000 (+0100) Subject: quicker name prefix assignment X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=f56158f7be449686094504a1eeafcd591186a801;p=serve0 quicker name prefix assignment --- diff --git a/db_meta.sh b/db_meta.sh index 588e62d..ffe7c4d 100755 --- a/db_meta.sh +++ b/db_meta.sh @@ -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 }