Renaming files

Hello,

I have some files which I would like to rename. These files are generated every 15 min and i would like to issue script that originally rename this file with one prefix like "BBB91."

original file is :

C20110415.1315-20110415.1330

desired one would be:

BBB91.20110415.1315-20110415.1330

this files are dynamic one and always change each 15 min
next one will look like

C20110415.1330-20110415.1345 
C20110415.1345-20110415.1400 .... 

Thanks in advance
hali

for i in C*
do
mv "$i" BBB91."${i#?}"
done

---------- Post updated at 07:33 PM ---------- Previous update was at 07:30 PM ----------

# ls -1 C*
C20110415.1330-20110415.1345
C20110415.1345-20110415.1400
# for i in C*
> do
> mv "$i" BBB91."${i#?}"
> done
# ls -1 C* BBB*
C*: No such file or directory
BBB91.20110415.1330-20110415.1345
BBB91.20110415.1345-20110415.1400
1 Like

Thanks ctsgnb, it works perfectly.

regards,
hali