Here is what I am trying to do
Please pick from the following
1) area1
2) area2
3) area3
Now pick a place based on the area you chose
1) place1
2) place2
3) place3
Based on $area and $place here is what you need...
My guess is i need a combination of case and if statements but i am unable to wrap my head around the problem.
Use the
select
statement as @Barmar suggested.Based on your example:
I used
a|b|c)
to group multiple options, but you could provide separate code paths for each one.*)
can be used as an "else" clause. Usebreak
to break out of the menu loop. Use;;
between clauses in thecase
statement and;
between statements in a single clause.