If you are using bash
, you can simply use brace expansion:
for i in {1..999}; do
printf "img_%03d.jpg\n" $i
done
This will print out:
img_001.jpg
img_002.jpg
...
img_998.jpg
img_999.jpg
To run your script using these as arguments you can use:
for i in {1..999}; do
./analyse $(printf "img_%03d.jpg" $i)
done
You could also replace the brace expansion with seq
:
for i in $(seq 1 999); do