choose

Select is deprecated use choose

SYNOPSIS

choose [-P error_message] [-C] [-V var] num list.. -p prompt [-ers]
[-d delim] [-i text] [-n nchars] [-N nchars] [-t timeout] [-u fd]

yesno msg

POSIXLY_CORRECT:
choose [-P error_message] [-V var] num list... -p prompt [-r] [-u fd]

DESCRIPTION

calls read in a loop until one of the valid answers are provided; This can be used in place of select builtin as it takes less space. All the options to read can be passed.

Though possible, you must not use -a and should not specify a variable for read for choose to work properly (instead use -V var).Also, you may specify -p prompt to override the default prompt for selection.

_Num_ specifies number of items in the list after which options to read start.

Extra options are:
P error message to be displayed if wrong choice is entered V store the responses in given variable C case insensitive matching for valid reponses

In POSIXLY_CORRECT mode, -d, -a, -e, -s, -i, -n , -N, -t, -C are ignored and have no effect

yesno calls choose with y yes n no as valid answers and "msg ([y]es/[n]o)? " as prompt. If the answer is y or yes(case insensitive) returns 0 or else returns non-zero.