Originally Posted by Garrett85
In my case the index number stored in FIRSTDIGIT & SECONDDIGIT will be bases on user input.
How exactly the two variables are assigned? I mean, what is the difference between the two from the user point of view?
By the way, if the input is a number from 1 to 12, you can subtract 1 from it:
FIRSTDIGIT=$((FIRSTDIGIT - 1))
Another way is to add a dummy value at the beginning of the array so that index 0 can be safely ignored:
CALENDER=(99 31 28 31 30 31 30 31 31 30 31 30 31)