summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-06-10 00:23:36 +0200
committerErich Eckner <git@eckner.net>2022-06-10 00:23:36 +0200
commit01002d2c6e03afbd914a3c7a9950cb9c212c42fe (patch)
tree002dfb1b63d94f09fc93c33850195396f9846058
parent4c6e1878bb65652cfce26cfbffdcfdbc539ff632 (diff)
downloadcopyPhotos-01002d2c6e03afbd914a3c7a9950cb9c212c42fe.tar.xz
nun wirklich für 0 und 1 Bilder
-rwxr-xr-xcopyPhotos12
1 files changed, 5 insertions, 7 deletions
diff --git a/copyPhotos b/copyPhotos
index ad3b033..0c2ba00 100755
--- a/copyPhotos
+++ b/copyPhotos
@@ -219,21 +219,19 @@ do
'
)
bild="$(
- echo "${!daten[@]}" | \
- tr ' ' '\n' | \
+ printf '%s\n' "${!daten[@]}" | \
grep "${re}" || true
)"
- if [ "$(echo "${bild}" | wc -l | cut -d' ' -f1)" -ne 1 ]
+ if [ "$(echo "${bild}" | grep -vxFc '' | cut -d' ' -f1)" -ne 1 ]
then
bild="$(
- echo "${!daten[@]}" | \
- tr ' ' '\n' | \
+ printf '%s\n' "${!daten[@]}" | \
grep "${re}.*\.[jJ][pP][gG]\$" || true
)"
fi
- if [ "$(printf '%s' "${bild}" | wc -l)" -ne 1 ]
+ if [ "$(printf '%s\n' "${bild}" | grep -vxFc '')" -ne 1 ]
then
- echo 'Nicht genau ein Treffer, sondern '"$(printf '%s' "${bild}" | wc -l)"':'
+ echo 'Nicht genau ein Treffer, sondern '"$(printf '%s\n' "${bild}" | grep -vxFc '')"':'
echo "${bild}" | \
sed 's|^| |'
read s