Loop over a range of numbers to download with wget
How can I write a bash script that is going to do the following:
URL = "example.com/imageID="
while (1..100)
wget URL + $i #it will wget example.com/imageID=1, then 2, then 3, etc
done
So I have a number of loops to perform, a URL which is ended with a number from the loop. I need to wget
all of these.
if you are using Bash 4.0, you can do this:
wget example.com/imageId={1..100}.jpg
It's fairly easy, even for someone with not much programming experience. When in doubt always read the Bash manual:
for i in {1..100}
do
wget "example.com/imageID=$i"
done