From: Bastian Dehn Date: Wed, 30 Sep 2026 07:54:20 +0000 (+0200) Subject: change checksum regex one line command X-Git-Tag: v1.0.3^2~5 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=9cf804448b24c207009411cab2f19cb244b1a913;p=albentohandy.git change checksum regex one line command --- diff --git a/src/albentohandy b/src/albentohandy index 4acc835..e08c442 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -119,14 +119,15 @@ cleanup_flac() calc_checksum() { + local regex= [ -n "$EXTENSIONS" ] \ || [ "${#EXTENSIONS[@]}" -ne 0 ] \ || EXTENSIONS=("ogg" "mp3" "opus" "flac") - regex=".*\(" - regex+=$(printf "\|\.%s" "${EXTENSIONS[@]}") - regex=${regex/\\\|/} - regex+="\)" + regex=$(printf "\|\.%s" "${EXTENSIONS[@]}" \ + | sed 's/\\|//' \ + | sed 's/^/.*\\(/' \ + | sed 's/$/\\)/') cd "$OUTPUT_PATH" || return $? find . -type f -regex "$regex" -print0 \