So I have this function
ren_barrow(){
for file in *.clu
do
mv -f $file ${file//RELEASE/"$1"}
done
}
but when I run this, as you can see everyfile that ends in .clu will be renamed.
I want to put an if statement around the mv that says if the filename contains RELEASE in it then carry on. If I do not have this if statement I get errors saying
Cannot rename: $file and $file is the same file.
ren_barrow(){
for file in *.clu
do
# if $file grep "RELEASE"; then
mv -f $file ${file//RELEASE/"$1"}
# fi
done
}