select Menus
select builds a numbered menu and loops until break. The chosen text goes into the variable. The example feeds the answer in.
Example
PS3="Pick: "
select opt in red green blue; do
echo "You chose $opt"
break
done <<< "2"Result
You chose green
Exercise
Menu keyword.
opt in a b c; do break; doneQuiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.