From: Paul Hänsch Date: Wed, 18 Jul 2018 01:31:55 +0000 (+0200) Subject: slight code improvements X-Git-Url: http://git.plutz.net/?p=serve0;a=commitdiff_plain;h=7b674b9084ef483caee686be6cc051920eae2a70 slight code improvements --- 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 }