pick [beta] [2] --- menu and prompt, on stderr 1 alpha 2 beta #? --- out of range and not a number pick [] [9] pick [] [beta] --- after the loop, the variable keeps the last pick last [beta] --- a blank line only prompts again ran [alpha] --- no in list means the parameters param [one] --- PS3 is the prompt 1 alpha 2 beta which? --- end of input ends the loop status 0 --- continue shows the menu again pass [alpha] pass [beta] [status 0]