The man page of select command clearly states where you when wrong
select name [ in word ] ; do list ; done
The list of words following in is expanded, generating a list of
items. The set of expanded words is printed on the standard
error, each preceded by a number. If the in word is omitted,
the positional parameters are printed (see PARAMETERS below).
The PS3 prompt is then displayed and a line read from the stan-
dard input. If the line consists of a number corresponding to
one of the displayed words, then the value of name is set to
that word. If the line is empty, the words and prompt are dis-
played again. If EOF is read, the command completes. Any other
value read causes name to be set to null.
select opt in $OPTIONS; do
Here OPTIONS represent the word in the syntax. Now When the OPTIONS is expanded, the list {Hello, Quit} is obatained which is printed as output, presceded by a number, as in the earlier part of the output.
1) Hello
2) Quit
Then the PS3 variable , in your system it is #? is displayed and waits for a user input. The select expects an input 1 or 2 when you press 1 the name(in syntax) ,ie in your program opt will take the value Hello. It matches the first if which prints the output as Hello world This continues until an EOF is encountered.
In the program, the exit in Quit causes an exit when 2 is pressed.
Expected output:
1) Hello
2) Quit
#? 1 <= my input
Hello World
#? 2 <= my input
done
selectprompt?Hello/Quitor1/2? It's a common mistake to enter the text in options, namelyHelloorQuitin your example. You should enter1or2.