[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Scripting question
- Subject: [ale] Scripting question
- From: fletch at phydeaux.org (fletch at phydeaux.org)
- Date: Fri Apr 22 00:33:07 2005
- In-reply-to: <[email protected]>
- References: <[email protected]>
> I have a directory with 148 ppm image files named like so:
> aea_h6_2-4ns_v2.0037.ppm
>
> I want to copy each file four times incrementing the name for each of
> the four copies. So the file aea_h6_2-4ns_v2.0000.ppm is copied and
> renamed to the destination directory as:
> aea.0000.ppm
> aea.0001.ppm
> aea.0002.ppm
> aea.0003.ppm
#!/bin/zsh
c=0
for i in {0000..0148} ; do
for j in {1..4} ; do
cp aea.$i.ppm dst/aea.$( printf "%04d" $c ).ppm
(( c = c + 1 ))
done
done
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org| Vincent, you should cease askin' \ o.O'
| scary questions." -- Jules =(___)=
| U