X-Git-Url: http://git.plutz.net/?p=serve0;a=blobdiff_plain;f=indexmeta.sh;fp=indexmeta.sh;h=45a3bac008b2ee469719d6ac2b91b3a0976b9178;hp=371c51f5dc010d9eb4394e401e536810e4bff932;hb=f34cc723fb9a552d65e40b6f4846160599eaa8b5;hpb=7b674b9084ef483caee686be6cc051920eae2a70 diff --git a/indexmeta.sh b/indexmeta.sh index 371c51f..45a3bac 100644 --- a/indexmeta.sh +++ b/indexmeta.sh @@ -69,7 +69,7 @@ meta_info(){ if [ -d "${meta%/meta}" ]; then grep -aF " $(meta_name "$file")" "$meta" \ - | grep -m1 -xE '[0-9]+ [0-9]+ [0-9]+ tags=[^ ]* comment=[^ ]* .+' \ + | grep -m1 -axE '[0-9]+ [0-9]+ [0-9]+ tags=[^ ]* comment=[^ ]* .+' \ || meta_file "$file" else printf '0\t0\t0\ttags=\tcomment=\t\r' @@ -84,7 +84,7 @@ meta_dir(){ if [ -d "$dir/.index" -a \! -f "$meta" ] && LOCK "$meta"; then touch "$meta" # preliminary touch to prevent concurrent generators find "$dir" -type f -mindepth 1 -maxdepth 1 \ - | grep -E "$file_pattern" \ + | grep -aE "$file_pattern" \ | while read -r v; do meta_line "$v" done >"$meta" @@ -93,7 +93,7 @@ meta_dir(){ elif [ -d "$dir/.index" -a "$dir" -nt "$meta" ] && LOCK "$meta"; then touch "$meta" find "$dir" -type f -mindepth 1 -maxdepth 1 \ - | grep -E "$file_pattern" \ + | grep -aE "$file_pattern" \ | while read -r v; do if [ "$v" -nt "$meta" ]; then grep -qF " $(meta_name "$v")" "$meta" \