Looping in Linux Shell Script

for i in *.mp3; do mv “$i” echo $i | tr `’ ‘ ‘_’`; done

In above tr `’ ‘ ‘_’` will replace all blanks in middle of filenames to _ (underscore).

To make all filenames lower case:
for i in *[Mm][Pp]3; do mv “$i” `echo $i | tr `[A-Z]’ `[a-z]’`; done