Quote:
I have designed a script menu, but I would like to to create sub menus e.g. I have my normal menu, then have a few options, and I for example choose option 2 and I would like it to take me to a whole new page (well, clear the screen) then allow me to choose from 5/6 options, which are functional. Dunno if that is clear but, ill give u an example:
Usual menu appears with 6 options e.g.
1. File functions
2. Directory functions
3. -
4. -
5. -
6. -
And say I choose option 1, I would like it to clear the screen and take me to a new sub-menu e.g.
1. Delete
2. Copy
3. Remove
etc
This is my menu script so far:
!/bin/ksh
amenu () {
clear
echo `date`
echo
echo "\t\t\tMy Personal Menu"
echo
echo "\t\tPlease Select:"
echo
echo "\t\t\t 1. Directory display"
echo "\t\t\t 2. Current Activity"
echo "\t\t\t 3. Who is logged on"
echo "\t\t\t 4. File functions"
echo "\t\t\t 5. Directory functions"
echo "\t\t\t 0. Exit"
echo Select by pressing a number and then ENTER ;
}
PressEnter () {
echo Press Enter
read x
}
DirectoryDisplay () {
ls -l|more
PressEnter
}
CurrentActivity () {
ps -ef|more
PressEnter
}
WhoIsLoggedOn () {
who|more
PressEnter
}
Filefuctions () {
?????????????????????????????
PressEnter
}
Directoryfunctions () {
?????????????????????????????
PressEnter
}
while true
do
amenu
read answer
case $answer in
1) DirectoryDisplay ;;
2) CurrentActivity ;;
3) WhoIsLoggedOn ;;
4) Filefunctions ;;
5) Directoryfunctions ;;
0) break ;;
esac
done
clear
------
Can ne1 that can help cut and paste the changes that I need to make (please see the quote above for more information).