How can I build an inner loop such that the loop condition depends on the outer loop run?
My very situation does probably not matter for the code I am looking for, but here it is: I have a crawler that I want to run on changing URLs, where the URL depends on two parameters. The first one is the year and the second one are pages, while the range of pages vary from year to year.
Here is what I tried so far
#!/bin/bash
numbers2004={625..721}
numbers2005={723..823}
for year in 2004 2005
do
for number in numbers$year
do
echo "$year $number"
done
done
It should give me
2004 625
2004 626
...
2004 720
2004 721
2005 723
2005 724
...
2005 822
2005 823