in reply to Re: Rename All Files In a Directory
in thread Rename All Files In a Directory

This is still because you don't check if the file returned is a directory.... In this case it matches '..', so the result is that $1 and $3 are empty, and the image name is '.'. When you try to rename you try to rename  /path/to/directory/. to  /path/to/directory._. To fix this Incorporate a check to see if it is a file or an directory, like mentioned in an earlier post: Re: Rename All Files In a Directory