[plug] clone files - increment name

Daniel Pittman daniel at rimspace.net
Mon Jul 28 21:15:25 WST 2008


"Keith Bawden" <keith at bawdo.com> writes:
> On Mon, Jul 28, 2008 at 21:27, Keith Bawden <keith at bawdo.com> wrote:
>>
>> for i in {1..100} ; do cp image.jpg `printf "image%03d.jpg" $i` ; done
>
> I forgot to mention if you use zsh instead of bash the above becomes a
> little simpler:
>
> for i in {001..100} ; do cp image.jpg  image${i}.jpg  ; done

(and you also forgot to mention that is a bash/zsh specific feature, not
part of the POSIX sh, and may not be sufficiently portable to all
platforms.

Regards,
        Daniel



More information about the plug mailing list