Hi, I'm new to bash, and have an example menu script using Zenity. It works fine if the user enters A B or C, but if the user enters nothing, I can only figure out how to exit the script. How do I get the menu to reappear if no input is selected?
The script is:
title="Select example"
prompt="Pick an option:"
options=("A" "B" "C")
while opt=$(zenity --title="$title" --text="$prompt" --list --column="Options" "${options[@]}"); do
select=""
case "$opt" in
"${options[0]}" ) select="A";;
"${options[1]}" ) select="B";;
"${options[2]}" ) select="C";;
# *) zenity --error --text="Invalid option, "OK" to exit" && exit 1;;
esac
# if $select = "A" ;then break ;fi
if zenity --question --text=" $select" ; then break ;fi
done > /dev/null 2>&1
Thanks fro any help.