summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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