From 5d6509ee238c89b0385fe7089bca2379db713d3a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 22 Jan 2023 12:40:47 +0100 Subject: copyPhotos: allow spaces in names --- copyPhotos | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/copyPhotos b/copyPhotos index 806c786..1ca4b85 100755 --- a/copyPhotos +++ b/copyPhotos @@ -71,17 +71,7 @@ then verwendung fi -for quelle in $( - find /mnt/{android/*/DCIM,usb}/ \ - -name Screenshots -prune , \ - -type f \ - \( \ - -iname "*.jpg" -o \ - -iname "*.rw2" -o \ - -iname "*.mts" \ - \) \ - ) -do +while read -r quelle; do datum="$(date -ud@"$(stat -c'%Y' "${quelle}")" '+%Y_%m_%d')" daten["${quelle}"]="${datum}" jahre["${datum}"]="${datum%%_*}" @@ -96,7 +86,20 @@ do else cp "${quelle}" "${zielVerzeichnis}/${datum}/" fi -done +done \ +< <( + find -files0-from <( + ls -d /mnt/{android/*/DCIM,usb}/ \ + | tr '\n' '\0' + ) \ + -name Screenshots -prune , \ + -type f \ + \( \ + -iname "*.jpg" -o \ + -iname "*.rw2" -o \ + -iname "*.mts" \ + \) \ +) summen="$( for quelle in "${!daten[@]}" -- cgit v1.2.3-70-g09d2