diff options
-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 |