So this is homework help for my intro to unix course.  I need to make a shell script called chExt.sh. that accepts a file extension and then multiple files.  It then needs to change the file extensions or state that the file does not exist../chExt.sh txt ocelot.cpp ../otherFolder/file.H cat.dog.TXT king cobra.dat is the general idea of the auto testers test.  The problem is that I haven't the faintest clue how to deal with the one file with a space in it's name.my code is:newExt=$1shiftfor x in $*do    fileName=$x    if test -f $fileName;    then        name=$(echo $fileName | rev | cut -f 2- -d '.' | rev)        newName=$name.$newExt        if test $newName != $fileName;        then            mv $x $newName        fi    else        echo $fileName: No such file    fidoneI've spent 3 days now trying to figure it out and google is no help.
Unix shell script, parameters with spaces
shell script