Bash script to batch rename files
A tiny mistake is not quoting $EXT1 in for f in *.$EXT1.
If it contains a space, the script won't work as expected.
I agree it's an unrealistic corner case,
but it's easy enough to protect against with proper quoting: for f in *."$EXT1".

The rename Perl script is famous for this purpose.
Since you asked about its advantages:


Stood the test of time
You don't have to write it
It has more features (full regex support)


The equivalent usage to simulate the behavior of your script would be:

rename -v 's/EXT1$/EXT2/' *.EXT1


A feature I like is the -n flag for dry run, to verify the renames that would be performed before actually performing them.