IFS=':' while read A B do FILE=${A/\//-} TEXT=${B/\*\./} printf "%s ---- %s\n" $FILE $TEXT convert text-x-generic.png -gravity center -pointsize 70 -stroke '#444' -strokewidth 2 -annotate -15 "$TEXT" -fill '#ff0' -annotate -15 "$TEXT" output/$FILE.png done < /usr/share/mime/globs