#!/bin/bash files=`ls *.jpg | cut -d. -f1` for file in $files do if [[ $file == *Long* ]]; then convert -gravity North -font Arial -pointsize 20 -annotate -120+0 $file $file.jpg added_name3/$file.jpg elif [[ $file == *Short* ]]; then convert -gravity North -font Arial -pointsize 24 -annotate -50+0 $file $file.jpg added_name3/$file.jpg else convert -gravity North -font Arial -pointsize 24 -annotate -50+0 $file $file.jpg added_name3/$file.jpg fi done