From f56158f7be449686094504a1eeafcd591186a801 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 22 Feb 2022 16:23:42 +0100 Subject: [PATCH] quicker name prefix assignment --- db_meta.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 } -- 2.39.2