bash: Batch Renaming File Extensions

Suppose I need to change the file extensions of certain files in a directory.

echo "Please specify a directory: "
read folder
cd $folder
for i in *.txt
    mv "$i" `basename $i txt`fasta

The directory address specified by the user is read into the script in line 2. This address is used to cd to the directory. This script changes the extensions of .txt files to .fasta.