convert file names to upper case using tr command in Unix

Hi All,

Need to convert file names to upper case using tr command in Unix.

In a folder -> /apps/dd01/misc

there are two files like:

pi-abcd.pdf
pi-efgh.pdf

The output of should be like:

pi-ABCD.pdf
pi-EFGH.pdf

I have used the command to work for a single file at a time like:

mv .pdf "pi-`ls -ltr *.pdf | awk '{print ($9)}' | cut -c 4-7 | tr '[a-z]' '[A-Z]'`.pdf"

How do we modify the above command so that it works out for multiple files in a folder as above.

Thanks for your time and help,

Regards,

for f in pi-*.pdf; do
	mv "$f" "pi-$(echo "$f" | cut -c 4-7 | tr '[a-z]' '[A-Z]').pdf"
done

Thanks a lot tkleczek ...it works.

Regards,

ls | perl -ne '{s/([^-]*-)([^.]*)/$1.uc($2)/e;print;}'