When you break
from the inner select
, you re-enter the top (main menu) select
- as you have discovered, the menu isn't displayed because you don't re-execute the commands at the beginning of the function. Instead, you can break out of the inner and outer selects at once, and have the main menu in a loop so that it gets called again, ie:
1 ) loadkeys be-latin1; echo "AZERTY Keyboard configured"; break 2;;
break 2
will break out of a select nested inside another, break 3
will break out of an additional level of nesting, etc. Then instead of just calling main_menu
at the bottom, do something like:
while :; do main_menu; done
This is an infinite loop which will call main_menu
whenever you break out of the main menu select
command. You may not want it to be infinite, you can always test against a variable or something there.