Okay, so I have this simple menu-driven BASH script. I'm still learning BASH, so "KISS" is my method, for the moment. The code below works, so that's cool ... take a look, i'll explain my issue on the other side ...
echo -en "\nWhat type of server is this? [DIGIT ONLY]\n\n1. cPanel\n2. Plesk\n3. Ubuntu\n4. No Panel / Simple Control Panel\n\nEnter Selection: "
read type
while true; do
case $type in
"1")
echo -en "Here is the stuff we can do for a cPanel server\n\n1. do this\n2. do that\n\nEnter Selection: ";
read cpopt
case $cpopt in
"1")
echo "sub1"
break
;;
"2")
echo "sub2"
break
;;
*)
echo "You did not choose an option, lets go back!"
break
;;
esac;;
"2")
echo "Plesk Stuff";
break
;;
"3")
echo "Ubuntu Stuff";
break
;;
"4")
echo "No Panel / Simple Control Panel";
break
;;
*)
echo "Invalid Input";
break
;;
esac
done
As you can see, each CASE statement works (so that's good), but here is what I'm trying to do ... I want to create a simple navigation system ... something that allows users 5-Levels deep to go back one level (or quit altogether). As you can see, I'm using BREAK, but that quits the whole script, so then I thought I would use a nested WHILE, thinking the BREAK would only break out of the loop it was in (the nested one) ... no joy, that also killed the whole script.
Since I'm learning, I'm not here looking for a definitive answer (although those are nice) ... I'm really looking for "You should read about XYZ, that will do that) ... and then I'll dive into that.
I very much appreciate any help that is offered, thank you!
selectloop?