Assuming that your files are named something_####.img what follows must
be one line):

echo | awk '{for(i=361;i<721;i++) printf "mv something_%d.img something_
%d.img\n",i+720,i;}' | bash -sf

I'd try first without piping it to bash just to make sure that it works
right.

On Fri, 2010-12-10 at 09:51 +0800, wu donghui wrote:
> Dear all,
> 
> 
> I need a script to renumber my image. My initial image number ranges
> from *_1081.img to *_1440.img. There are 360 images in total. I want
> to renumber these images with the ranges from *_361.img to *_720.img,
> that means every initial image-720, but I don't know how to do it.
> Below is my script draft.
> 
> 
> 
> 
> 
> 
> #! /bin/csh -f
> 
> 
> @ i = 1081
> 
> 
> while ( $i >= 1081 ) 
> while ($i <= 1440 )
> echo mv CD267A_3_pk_1_$i.img CD267A_3_pk_1_$i-720.img
>   @ i++
> end
> 
> 
> exit
> 
> 
> 
> 
> 
> 
> Can anyone help me for this script? Thank you very much.
> 
> 
> 
> 
> Best regards,
> 
> 
> Donghui

-- 
"I'd jump in myself, if I weren't so good at whistling."
                               Julian, King of Lemurs

Reply via email to