- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Problems when creating a set of menus via shel...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО08-28-2002 03:58 AM
тАО08-28-2002 03:58 AM
I am new to shell scripting and am trying to create a set of menus from scratch. I have created the menus and linked them together, but when i type quit i get sent back to the previous menu instead of returning to the command line. is there anyway of getting the menus to exit straight to the command line, rather then having to type quit for each copy of the menu i have visited.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2002 04:00 AM
тАО08-28-2002 04:00 AM
Re: Problems when creating a set of menus via shell scripts
This might help:-
continue="yes"
while [ "$continue" = "yes" ]
do
clear
echo "--------------------------------- "
echo " MAIN MENU "
echo " -------------------------------- "
echo "| |"
echo "| 1 : SYSTEM CHECKS |"
echo "| 2 : SPIDERS |"
echo "| 3 : SAM |"
echo "| 4 : System Control |"
echo "| 5 : UV Admin |"
echo "| 6 : Misc Checks |"
echo "| 7 : Predictive |"
echo "| 8 : S.T.M. |"
echo "| 99 : Make Recovery |"
echo "| x : Exit Menu |"
echo " -------------------------------- "
echo "| PJFC 02/2000 |"
echo " -------------------------------- "
# updated for new sys checks
read ans
case $ans in
1) ./sysadmin/menu/syschk
;;
11) telnet 191.1.0.103
;;
111) telnet 191.1.0.105
;;
2) ./sysadmin/menu/spider
;;
3) sam
;;
4) ./sysadmin/menu/control
;;
5) cd /universe/uv
uv
;;
6) ./sysadmin/menu/checks
;;
7) ./opt/pred/bin/psconfig
;;
8) ./usr/sbin/stm/ui/bin/stm
;;
99) ./opt/ignite/bin/make_tape_recovery -x inc_entire=vg00 -I -v -a /dev/rmt/1mn
;;
x) continue="no"
;;
X) continue="no"
;;
esac
done
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2002 04:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2002 04:10 AM
тАО08-28-2002 04:10 AM
Re: Problems when creating a set of menus via shell scripts
Change these lines where you call another menu:
testment:
1) echo "Day Tasks"
sleep 2
daytasks
;;
to
exec daytasks
daytasks:
4) echo "Back to main menu"
sleep 1
testmenu
;;
to
exec testmenu
Although crappy coding IMO, its the solution you are looking for.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2002 04:12 AM
тАО08-28-2002 04:12 AM
Re: Problems when creating a set of menus via shell scripts
FYI http://www.introcomp.co.uk/examples/index.html
contains some good examples
Solutions.
After you call a new menu in a script put the word exit on the next line so the menu will
return to the previous menu and autoexit
ro
Use
. menu
To activate menus.This stops the shell forking and continues at the same shell level.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2002 04:15 AM
тАО08-28-2002 04:15 AM
Re: Problems when creating a set of menus via shell scripts
If you divide your submenus into functions, you can use the 'return' command to exit the function (submenu) and thereby return to the "outer block" (main menu). If you wish to abandon processing within a function without further ado, use 'exit' in lieu of the 'return' statement.
Have a look at the 'sh_posix' man pages. A quick overview of shell commands can be found here ("Shells: User's Guide"):
http://docs.hp.com/hpux/onlinedocs/B2355-90046/B2355-90046.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2002 04:19 AM
тАО08-28-2002 04:19 AM
Re: Problems when creating a set of menus via shell scripts
Thanks for all your help, this now works.
Regards
Keith Fuller
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2005 07:27 AM
тАО05-13-2005 07:27 AM
Re: Problems when creating a set of menus via shell scripts
Thanks a lot for the responses so far. If/when I come up with a solution, I'd like to post the script, if I complete it :-) Well, at least the parts that are breaking my brain at the moment.
Thanks!
Adam.