EX:
$ progaddtext file1 .txt<br>
should rename file1 to file1.txt
I found this code to successfully remove the text from the end of the first arg.
mv $1 $(echo $1 | sed "s/$2$//")
Just having a little trouble figuring out how to do the reverse.
Even though using mmv or rename would be much easier, and this question seems to lack a homework tag?