Others have answered the issue, here are some other points:
1. Be consistent with testing, ie. if you are going to use (()) for testing numbers, like in your for loops, do not start your script by using []. Especially as (()) is designed specifically for dealing with numbers
Code:
if ! [ $MAX_NO -ge 5 -a $MAX_NO -le 9 ] ; then
if ! (( MAX_NO >= 5 && MAX_NO <= 9 )) ; then
2. As above with placing 'do' on same line or on next line, if you are going to place on the next line then place 'then' for your 'if' on the next line too
Code:
if ! (( MAX_NO >= 5 && MAX_NO <= 9 )) ; then
if ! (( MAX_NO >= 5 && MAX_NO <= 9 ))
then
3. Your 'if' advises the user to try again, but to do this they currently need to re-run the script. Maybe try putting the test in a loop. Remember though, if you do this, you might also need to offer
them a way out
4. I would also suggest having a look at how you might reduce your code from needing 6 for loops (hint: if you search this site for something like 'pyramid', I think you might find some alternatives)
My last thought is a question ... your current solution repeats the longest line, ie. if you user enters 5 then they get a diamond shape with 2 rows of 5 dots in the center. Unless this was the question
asked, I would think the diamond should be uniform and only have a single row of maximum dots (even if not, it would make a good challenge for you to work out how to solve
)