Ben,
does this assume that the current folder contains only the files to be
renamed? Also, how does one add padding zeros?
While Donghui didn't need zero padding, my one liner can be easily
corrected to do this in the same way Ian's is, by replacing
%d with %0nd, where n is the total number of digits one desires.
Ed.
On Thu, 2010-12-09 at 21:42 -0500, Ben Eisenbraun wrote:
> > #! /bin/csh -f
>
> That's your problem right there! You don't need a script at all.
>
> In bash/ksh/zsh right on the command line:
>
> c=361 && for f in * ; do mv $f CD267A_3_pk_1_$c.img ; c=$(($c+1)) ; done
>
> Bill Scott probably has some zsh slickness to do the same thing without
> the loop, but too much magic gives me the willies.
>
> -b
>
> --
> | Ben Eisenbraun
> | SBGrid Consortium | http://sbgrid.org |
> | Harvard Medical School | http://hms.harvard.edu |
--
"I'd jump in myself, if I weren't so good at whistling."
Julian, King of Lemurs
|