randomi have one file named image.jpg but extension can be other..
I want to rename these file using bash
keep extension but name is in contains variable.
ex
var1="cat"
var2="dog"
image.png -> cat.png
image.jpeg -> dog.jpeg
I think I should look in the folder the file named image *. *, copy the extension, and then use the variable name + extension in new name.
     namefinal=$random
      ext=`echo $ls image*.*`
        echo $ext
        EXTENSION=`echo "$ext" | cut -d'.' -f2`
    echo $EXTENSION
mv $ext $random.$EXTENSION
done!, thanks.
 
    