diff options
author | Erich Eckner <git@eckner.net> | 2022-06-10 00:23:36 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2022-06-10 00:23:36 +0200 |
commit | 01002d2c6e03afbd914a3c7a9950cb9c212c42fe (patch) | |
tree | 002dfb1b63d94f09fc93c33850195396f9846058 | |
parent | 4c6e1878bb65652cfce26cfbffdcfdbc539ff632 (diff) | |
download | copyPhotos-01002d2c6e03afbd914a3c7a9950cb9c212c42fe.tar.xz |
nun wirklich für 0 und 1 Bilder
-rwxr-xr-x | copyPhotos | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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 |