Bash menu script

I have a main menu

quit=n 
while [  "$quit"   =   "n"  ] 
do 
clear 
echo 
echo "1. General system information" 
echo "2. Hardware utilisation information" 
echo "3. File management"
echo "4. User information"
echo "5. Information on network connectivity"
echo "6. Information on processes" 
echo "Q.Quit" 
echo 
echo "Enter choice" 
read choice 
case $choice in 
1)./gensysinfo
  read junk;;
2)./hardutilinfo
  read junk;;
3)./fileman 
  read junk;;
4)./userinfo
  read junk;;
5)./netinfo
  read junk;;
6)./procinfo 
  read junk;;
Q|q) quit=y;; 
*) echo "Try Again" 
sleep 1 
esac 
done 
echo "Thankyou, Come again" 

This is a sub menu

echo
echo "1. Amount of RAM and the percentage used"
echo "2. Amount of swap space and the percentage used"
echo "3. Size of the CPU run queue and the extent to which the CPU is utilised"
echo "4. Main Menu"
echo
echo "Enter choice" 
read choice 
case $choice in 
1)free|awk '/Mem/{print "Total amount of RAM(Kbytes):" $2 "\nAmount of used RAM(%): " (($4 / $2) * 100)}'
echo
echo "Hit the Enter key to continue"
read junk;;
2)free|awk '/Swap/{print "Total amount of Swap Space(Kbytes):" $2 "\nAmount of used Swap Sapce(%): "(($4 / $2) * 100)}'
echo
echo "Hit the Enter key to  continue"
read junk;;
3)vmstat| tail -1 | awk '{print "Size of CPU run queue: " $1}'
top -bn1 | awk '/Cpu/{print "Amount of CPU utilised by us(userspace)(%): " $2 "\nAmount of CPU utilised by sy(system calls)(%): " $3 "\nAmount of CPU utilised by ni(reniced processes)(%): " $4 "\nAmount of CPU utilised by id(idle)(%): " $5 "\nAmount of CPU utilised by wa(waiting for i/o)(%): " $6 "\nAmount of CPU utilised by hi(hardware interrupts)(%): " $7 "\nAmount of CPU utilised by si(software interrupts)(%): " $8 }'
echo
echo "Hit the Enter key to continue"
read junk;;
4)./script
read junk;;
esac

What do i need to add to stay on the menu when "y" and go go to main menu when "n"

what I have atm just completes one option then quits menu.
I've been at this all day and my i can't see the solution..

I think it will be something like the first menu but i'm not sure how to go back to main when "n" is inputted.

Jade.

You need a loop for the sub menu as well, just like for the main menu. Since you are using external scripts you can even keep the same variable names. When n is input it will automatically resume the main menu. You do not need "read junk" in the main menu since there is one in the submenu.

Have you tried the "select" in bash ?
look there (...)/Bash_scripting_Tutorial#14-bash-select
On that page you can find a lot of other interesting possibilities of the shell.

Jade,

We have a coursework/homework forum with dedicated rules. You are welcome to post there following those rules.

The staff here are aware of your course and the assignment that you are doing and have previously banned students who tried to conceal the fact that it was a course assignment.