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.