You use the
select statement to generate a menu list if you are writing a shell program that expects input from the user online. The format of the
select statement is as follows:
select item in itemlistdo StatementsDone
itemlist is optional. If it isn’t provided, the system iterates through the
item entries one at a time. If
itemlist is provided, however, the system iterates for each entry in
itemlist and the current value of
itemlist is assigned to
item for each iteration, which then can be used as part of the statements being executed.
If you want to write a menu that gives the user a choice of picking a
Continue or a
Finish, you can write the following shell program:
#!/bin/kshselect item in Continue Finish ...