HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Working with menus ...
Operating System - Linux
1828316
Members
3403
Online
109976
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2007 06:11 PM
04-07-2007 06:11 PM
Hi ...
how can i do a "sub-menu" into a menu?
I mean ..
for example, i have the following:
#!/usr/bin/ksh
clear
. $HOME/ENVIRONMENT/environment.sh
echo "###############################################################"
echo " "; banner "DRT MENU"
echo ""
echo " Server: $(hostname) ----- $(date) "
echo "###############################################################"
echo " "
lista='
DELETE_FILES
GET_FILES_SYSTEM_ALL_LEGACY_SERVERS
REMOTE_FILE_DISTRIBUTION_TO_ALL_LEGACY_SERVERS
STARTING_CRON_IN_ALL_LEGAY_SERVERS.sh
EXIT'
PS3="Option : "
select opcion in $lista
do
case $opcion in
"DELETE_FILES" ) ????????????? ;;
"GET_FILES_SYSTEM_ALL_LEGACY_SERVERS" ) ${menu}/hola.sh ;;
"REMOTE_FILE_DISTRIBUTION_TO_ALL_LEGACY_SERVERS" ) ${menu}/hola.sh ;;
"STARTING_CRON_IN_ALL_LEGAY_SERVERS.sh" ) ${menu}/hola.sh ;;
"EXIT" ) exit ;;
esac
done
into DELETE_FILES (where it says ?????????? )Option i need to put other sumbenu for choosing other options ... how can i do that???
PLEASE LET ME KNOW
how can i do a "sub-menu" into a menu?
I mean ..
for example, i have the following:
#!/usr/bin/ksh
clear
. $HOME/ENVIRONMENT/environment.sh
echo "###############################################################"
echo " "; banner "DRT MENU"
echo ""
echo " Server: $(hostname) ----- $(date) "
echo "###############################################################"
echo " "
lista='
DELETE_FILES
GET_FILES_SYSTEM_ALL_LEGACY_SERVERS
REMOTE_FILE_DISTRIBUTION_TO_ALL_LEGACY_SERVERS
STARTING_CRON_IN_ALL_LEGAY_SERVERS.sh
EXIT'
PS3="Option : "
select opcion in $lista
do
case $opcion in
"DELETE_FILES" ) ????????????? ;;
"GET_FILES_SYSTEM_ALL_LEGACY_SERVERS" ) ${menu}/hola.sh ;;
"REMOTE_FILE_DISTRIBUTION_TO_ALL_LEGACY_SERVERS" ) ${menu}/hola.sh ;;
"STARTING_CRON_IN_ALL_LEGAY_SERVERS.sh" ) ${menu}/hola.sh ;;
"EXIT" ) exit ;;
esac
done
into DELETE_FILES (where it says ?????????? )Option i need to put other sumbenu for choosing other options ... how can i do that???
PLEASE LET ME KNOW
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2007 03:05 AM
04-08-2007 03:05 AM
Solution
Hi Manuales:
Simply add another 'select' loop.
...
listb='
FILESET1
FILESET2
FILESET3
QUIT'
...
"DELETE_FILES" )
echo "Deleting..."
PS3="Reply : "
select reply in $listb
do
case $reply in
"FILESET1" ) echo "deleting #1" ;;
"FILESET2" ) echo "deleting #2" ;;
"FILESET3" ) echo "deleting #3" ;;
"QUIT" ) PS3="Option : "; break ;;
esac
done
;;
...
NOTE that you need to reset the 'PS3' prompt as you leave the inner 'select' loop. Otherwise your user will continue to be prompted with "Reply" as established for the current loop.
Regards!
...JRF...
Simply add another 'select' loop.
...
listb='
FILESET1
FILESET2
FILESET3
QUIT'
...
"DELETE_FILES" )
echo "Deleting..."
PS3="Reply : "
select reply in $listb
do
case $reply in
"FILESET1" ) echo "deleting #1" ;;
"FILESET2" ) echo "deleting #2" ;;
"FILESET3" ) echo "deleting #3" ;;
"QUIT" ) PS3="Option : "; break ;;
esac
done
;;
...
NOTE that you need to reset the 'PS3' prompt as you leave the inner 'select' loop. Otherwise your user will continue to be prompted with "Reply" as established for the current loop.
Regards!
...JRF...
- Tags:
- select
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP