I am trying to write a script and make it as clean and light as possible. In short I want to present a menu and have a person pick a number that corresponds with their favorite color. From there I want to take the color name that was with the number in the menu and use it as a variable that will be placed in the script elsewhere. My goal is to have one syntax after the menu but will use the color variable. This is the one piece that is setting me back. Below is a snippet.. any thoughts?
color_pref=
while [ -z "$color_pref" ] ;
do
echo
echo
echo " ***************************************"
echo " What is your favorite color? "
echo " 1 - red"
echo " 2 - blue"
echo " 3 - green"
echo " 4 - orange"
echo " Select 1, 2, 3, or 4 :" \n
echo " ***************************************"
printf " Enter Selection> "; read color_pref
echo [[[whatever variable is for color selected]]]