summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-07-10 21:08:57 +0200
committerErich Eckner <git@eckner.net>2019-07-10 21:08:57 +0200
commitdc2a57bad09aa84af42ec119eaf22c20bee85e35 (patch)
tree0cde1aafd99a53b2ea36c478561a2a8d3166dd3f
parent829dbea51fe6caa9be9e25190c26a266174b4f13 (diff)
downloadcopyPhotos-dc2a57bad09aa84af42ec119eaf22c20bee85e35.tar.xz
copyPhotos: do not exit on non-matching regex
-rwxr-xr-xcopyPhotos4
1 files changed, 2 insertions, 2 deletions
diff --git a/copyPhotos b/copyPhotos
index 74b5073..de4d4b7 100755
--- a/copyPhotos
+++ b/copyPhotos
@@ -215,10 +215,10 @@ do
bild="$(
echo "${!daten[@]}" | \
tr ' ' '\n' | \
- grep "${re}.*\.[jJ][pP][gG]\$"
+ grep "${re}.*\.[jJ][pP][gG]\$" || true
)"
fi
- if [ "$(echo "${bild}" | wc -l | cut -d' ' -f1)" -ne 1 ]
+ if [ "$(echo "${bild}" | wc -l | cut -d' ' -f1)" -ne 1 ] || [ -z "${bild}" ]
then
echo 'Nicht genau ein Treffer, sondern '"$(echo "${bild}" | wc -l | cut -d' ' -f1)"':'
echo "${bild}" | \