Hi. I have files in a directory with names like:
1.tif
2.tif
3.tif
.
.
.
n.tif
I need to rename these files to YYYYMMDD_SEQ_CTR.tif, where 'YYYYMMDD' = date (duh), 'SEQ' = a pre-assigned sequence number, and 'CTR' = a counter that I just increment for each file in the dir. So, I have the following code:
ctr=0
for i in *.tif
do
let "ctr+=1"
newtifname=$DATEDIR"_"$SEQ"_"$ctr".tif"
mv "$i" $newtifname
done
But when I execute this code, I get this error:
mv: cannot stat `*.tif': No such file or directory
Anyone know what I'm doing wrong?
Thanks!
Scott
1.tif
2.tif
3.tif
.
.
.
n.tif
I need to rename these files to YYYYMMDD_SEQ_CTR.tif, where 'YYYYMMDD' = date (duh), 'SEQ' = a pre-assigned sequence number, and 'CTR' = a counter that I just increment for each file in the dir. So, I have the following code:
ctr=0
for i in *.tif
do
let "ctr+=1"
newtifname=$DATEDIR"_"$SEQ"_"$ctr".tif"
mv "$i" $newtifname
done
But when I execute this code, I get this error:
mv: cannot stat `*.tif': No such file or directory
Anyone know what I'm doing wrong?
Thanks!
Scott