From 7b674b9084ef483caee686be6cc051920eae2a70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 18 Jul 2018 03:31:55 +0200 Subject: [PATCH] slight code improvements --- indexmeta.sh | 4 ++-- list.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indexmeta.sh b/indexmeta.sh index 4545df9..371c51f 100644 --- a/indexmeta.sh +++ b/indexmeta.sh @@ -85,7 +85,7 @@ meta_dir(){ touch "$meta" # preliminary touch to prevent concurrent generators find "$dir" -type f -mindepth 1 -maxdepth 1 \ | grep -E "$file_pattern" \ - | while v="$(line)"; do + | while read -r v; do meta_line "$v" done >"$meta" @@ -94,7 +94,7 @@ meta_dir(){ touch "$meta" find "$dir" -type f -mindepth 1 -maxdepth 1 \ | grep -E "$file_pattern" \ - | while v="$(line)"; do + | while read -r v; do if [ "$v" -nt "$meta" ]; then grep -qF " $(meta_name "$v")" "$meta" \ || meta_line "$v" diff --git a/list.sh b/list.sh index d729c6c..2dc1a83 100644 --- a/list.sh +++ b/list.sh @@ -89,7 +89,7 @@ list_index(){ local meta (cd "$_DATA/$ITEM"; find ./ -path '*/.index/meta' - ) | while meta="$(line)"; do + ) | while read -r meta; do list_filemeta "${meta%/.index/meta}" done } -- 2.39.2