On Mon, Oct 09, 2000 at 04:57:45PM -0400, Chris Mason (chris@net.ai) wrote:
> Can anyone give me a shell script that wil take all the fies, named
> whatever.jpg, and rename them in a sequential numbered sequence, i.e.,
> 1.jpg, 2.jpg, 3.jpg, etc. They will always be JPGs, so the extensions won't
> change.
> Much appreciate the help.
Untested code:
i=1; for file in *.jpg; do mv $file $i.jpg; i=$(( i + 1 )); done
Try running it with an 'echo' first:
i=1; for file in *.jpg; do echo "mv $file $i.jpg"; i=$(( i + 1 )); done
...you'll see what commands are issued.
--
Karsten M. Self <kmself@ix.netcom.com> http://www.netcom.com/~kmself
Evangelist, Opensales, Inc. http://www.opensales.org
What part of "Gestalt" don't you understand? There is no K5 cabal
http://gestalt-system.sourceforge.net/ http://www.kuro5hin.org
GPG fingerprint: F932 8B25 5FDD 2528 D595 DC61 3847 889F 55F2 B9B0
Attachment:
pgpAZfxwUBpwl.pgp
Description: PGP signature