Please use ***[code][/code]
*** tags around your code and data, to preserve the original formatting and to improve readability. Do not
use quote tags, bolding, colors, "start/end" lines, or other creative techniques.
I recommend not putting the submenu function definition inside the main menu function. Functions are generally intended to be defined at the top of the script, so that they will be sitting in the environment ready to use when you need them.
It also lessens the clutter, helping readability.
Also, your first loop has an error:
while #should be "while :"
By the way, many experienced scripters feel that it's more readable to place the "do/then
" keywords on the same line as the "for/while/until/if
" keywords, as it more clearly separates the outside block from the inside block. Be sure to indent all sub-commands properly, too.
while true; do
I also personally prefer using the true
keyword to ":" in this kind of loop.