summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-01-22 12:40:47 +0100
committerErich Eckner <git@eckner.net>2023-01-22 12:40:47 +0100
commit5d6509ee238c89b0385fe7089bca2379db713d3a (patch)
tree26ebebd1238a0058deba4b35e4808f1790371727
parent95165d1c7490f3331fed404d656c00156cdbccc3 (diff)
downloadcopyPhotos-5d6509ee238c89b0385fe7089bca2379db713d3a.tar.xz
copyPhotos: allow spaces in names
-rwxr-xr-xcopyPhotos27
1 files 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[@]}"