File name extensions

Hello people, I was wondering if anyone could help me?

I want to produce a shell script that changes the filename extension on all matching file.

E.G. change all files called �something.rtf' to �something.doc' by giving the command:

Changex rtf doc

*where �Changex' is the name of my shell script.

Does anyone know how to do this or know what �functions' I should use???

with regards,
nick

#! /usr/bin/ksh

old=$1
new=$2

for file in *.$old ; do
     mv $file ${file%$old}$new
done
exit 0

fantastic - it works!!! - you are a genius!!!