Quit if no keywords found.
This commit is contained in:
@@ -53,13 +53,17 @@ exif=$(exiftool -Canon -s -Keywords "$file")
|
|||||||
# error occurred, or 2 if all files failed the -if condition (for any of
|
# error occurred, or 2 if all files failed the -if condition (for any of
|
||||||
# the commands if -execute was used).
|
# the commands if -execute was used).
|
||||||
|
|
||||||
#echo "$exif"
|
|
||||||
# Keywords : Anemone pulsatilla, Anemone pulsatille, _bleu_
|
|
||||||
|
|
||||||
# keywords
|
# keywords
|
||||||
k=$(echo "$exif" | sed -n '/^Keywords/p' | awk -F":" '{print $2}' | sed 's/^ *//g')
|
k=$(echo "$exif" | sed -n '/^Keywords/p' | awk -F":" '{print $2}' | sed 's/^ *//g')
|
||||||
# _vert_, accouplement, brocard, capreolus capreolus, chevrette, chevreuil, rut
|
# _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_
|
# Anemone pulsatilla, Anemone pulsatille, _bleu_
|
||||||
|
|
||||||
IFS="," read -a key <<< "$k"
|
IFS="," read -a key <<< "$k"
|
||||||
@@ -75,8 +79,6 @@ do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
k_fr=$(echo "$ii")
|
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
|
if [ -n "$k_en" ]; then
|
||||||
echo "fr & en"
|
echo "fr & en"
|
||||||
|
|||||||
Reference in New Issue
Block a user