for I in *.jpg; do echo file=$I doneWorks fine unless there are no .jpg files. In that case it executes the loop once with I set to *.jpg -- not very nice. Here's an variation that handles zero matches:
for I in $(ls *.jpg 2>/dev/null); do echo file=$I doneThis works but is slightly slower since it shells out the ls command.