Checking if file extension exist

view story

http://www.unix.com – I know i'm asking a lot of questions, but im just starting to learn this and it is very different that c so heres my new question im writing a script that changes file extension and or ending of files with not extensions. I have the code working to change the extension, but i'm trying to tell the user when they enter an extension that does not exist so they know there was an error in input. Here is what I have so far. Code: #/!bin/bash echo $1 $2 if [ $# -ne 2 ]; then   echo "Expected 2 arguments! script will now exit"   exit 1 fi for file in *$1; (HowTos)