Command Format: select identifier [in list]
In the select command:
ksh will display the items in one or more columns on standard
error, each preceded by a number. The PS3 prompt follows. The
number of columns is determined by the values of COLUMNS and LINES.
ksh will then read a selection line from standard input. If the
line is the number of one of the displayed items, ksh sets the
value of "identifier" to the item corresponding to this number. If
the line is empty, ksh again displays the list of items; and the
prompt is redisplayed. The "commands" are not executed.
ksh saves the contents of the selection line read from standard
input in the KornShell variable REPLY.
ksh runs "commands" for each selection until ksh encounters a
break, return, or exit command in the "commands" list.
select myselection in fred wilma pebbles barney betty
case $myselection in
echo Fred was the selection
echo Wilma was the selection
echo Pebbles was the selection
echo Barney was the selection
echo Betty was the selection
$chmod 755 select.ksh
Pebbles was the selection
Betty was the selection
Barney was the selection