multiples menu in ksh

Hi,

IS possible in ksh to make multiples menus?

For example:

My menu.
1)Option1
   1.1)Option1.1
   2.3)Option1.2
2)Option2
  2.1)Option2.1
.
.
.
x)Exit

I've tried with case but no success.

Thanks in advance.
Israel

Styled after IBM S36 menus and a DOS shareware program called Automenu.

If you are using ksh93, the select keyword is for creating menus. Here is the relevant except from ksh94 man page.

select vname [ in word ... ] ;do list ;done

A select command prints on standard error (file descriptor 2) the set of words, each preceded by a number. If in word... is omitted, the positional parameters starting from 1 are used instead. See Parameter Expansion. The PS3 prompt is printed and a line is read from the standard input. If this line consists of the number of one of the listed words, then the value of the variable vname is set to the word corresponding to this number. If this line is empty, the selection list is printed again. Otherwise the value of the variable vname is set to null. The contents of the line read from standard input is saved in the variable REPLY. The list is executed for each selection until a break or EOF is encountered. If the REPLY variable is set to null by the execution of list, the selection list is printed before displaying the PS3 prompt for the next selection.

example:

#!/bin/ksh

echo "Hello"
echo "Please select a chioce:"

PS3="Choose a number: "
CHOISE='one two three quit'
select i in $CHOISE
do
  case $i in
        one)  echo "selected one";;
        two)  echo "selected two";;
      three)  echo "selected three";;
       quit)  exit;;
          *)  echo "\nInvalid Choice\n";;
  esac
done

You can also add submenus inside a case
in Linux in the end if you add

REPLY=

it will re prompt the menu.