Quit if no keywords found.

This commit is contained in:
2022-08-19 18:07:23 +02:00
parent 9239e28269
commit 0168eedde8

View File

@@ -53,13 +53,17 @@ exif=$(exiftool -Canon -s -Keywords "$file")
# error occurred, or 2 if all files failed the -if condition (for any of
# the commands if -execute was used).
#echo "$exif"
# Keywords : Anemone pulsatilla, Anemone pulsatille, _bleu_
# keywords
k=$(echo "$exif" | sed -n '/^Keywords/p' | awk -F":" '{print $2}' | sed 's/^ *//g')
# _vert_, accouplement, brocard, capreolus capreolus, chevrette, chevreuil, rut
echo "$k"
if [ -z "$k" ]; then
echo -e "${bold}${red}No Keywords found !${reset}"
echo "Quit."
exit 1
fi
# Anemone pulsatilla, Anemone pulsatille, _bleu_
IFS="," read -a key <<< "$k"
@@ -75,8 +79,6 @@ do
fi
k_fr=$(echo "$ii")
echo "k_fr: $k_fr long: "${#k_fr}
echo "k_en: $k_en long: "${#k_en}
if [ -n "$k_en" ]; then
echo "fr & en"