I find the easiest way to change file extensions in shell scripts is through the use of parameter substitution of variables. Consider the following:
Code:
$ somevar=filename.ext
$ echo ${somevar}
filename.ext
$ echo ${somevar%.ext}
filename
$ echo ${somevar%.*}
filename
$ newvar=somefile.someotherext
$ echo ${newvar%.*}
somefile
$ yetanothervar=somefile.padding.ext
$ echo ${yetanothervar%.*}
somefile.padding
See
http://tldp.org/LDP/abs/html/paramet...stitution.html for a more elegant and in depth explanation.