- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need help with some shell programming ideas --...
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
Forums
Discussions
Discussions
Discussions
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
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
05-13-2005 05:42 AM
05-13-2005 05:42 AM
Need help with some shell programming ideas -- Menu driven
1. I would like to provide a screen which has the output from results parsed from a file. On that screen I would like to allow the user to arrow up/down through the options, and select the desired "server name" as these are shown to be available (example of what I would like to accomplish shown in file "ScreenSelectionSample.txt").
The "server names" come from a file that I would need to parse to get the results from.
The file format looks like the attached example (file attached named "parsefile_Extract.txt" -- only a sample portion example)
Here are the few problems I have:
1. How do I enable my screen to do selections (arrow up/down) based on displayed results as example provided (only left column where the desired server name is shown)
2. How do I parse the file to obtain not only the server name, but also the minimum number of servers to run, the max, the number actually running (explained below and shown in processes snapshot), and the IDs that are still available to fire up some more -- I need to add coding that shall permit adding/removing more of these services, based on limits provided in the file.
For example:
The processes file I am providing below has for:
service2Svr_X0| NABEAPP| 100| 2| 2| 8|
This means, a 2 minimum required, 2 have started, 8 is the max, the IDs to be used are 100-107 (100 and 101 already running):
userapp 27142 1 0 May 11 ttyp6 0:25 service2Svr_X0 -g 2 -i 100 -u hostXX -U /apath/app/c
userapp 27271 1 0 May 11 ttyp6 0:24 service2Svr_X0 -g 2 -i 101 -u hostXX -U /apath/app/c
I may need to break down this since there are a few questions here, but would like to start with the menu portion. Thanks for any help, I shall give points as each portion is answered.
Once again, any ideas are welcome (and no, I don't have perl experience, but possibly next month after I take the course, when I may need to convert this whole shell script to perl).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 05:43 AM
05-13-2005 05:43 AM
Re: Need help with some shell programming ideas -- Menu driven
Menu concept...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 05:44 AM
05-13-2005 05:44 AM
Re: Need help with some shell programming ideas -- Menu driven
File to be parsed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 05:45 AM
05-13-2005 05:45 AM
Re: Need help with some shell programming ideas -- Menu driven
List of processes...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 05:56 AM
05-13-2005 05:56 AM
Re: Need help with some shell programming ideas -- Menu driven
Fri May 13 11:54:22 MDT 2005
UNIX LP Support Menu
Please Select:
a. Check printer status
b. Add Printer
c. Delete Printer
d. Disable a Print Queue
e. Enable a Print Queue
f. Backup the Spooler Configuration
g. Restore the Spooler Configuration
h. Check the Print Spooler log
i. Check the iprprtpkg log
j. Check the iprprtpkg status
x. Exit
Select by pressing the letter and then ENTER
It might give you some ideas...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 06:21 AM
05-13-2005 06:21 AM
Re: Need help with some shell programming ideas -- Menu driven
However, my main issue is that the "menu" per say that I would like to put together will need to be based on the available services as prescribed by the parsed file and the applicable services that are already running. If possible I would like to allow the user to select an option instead of making them type anything at all in this menu.
Thanks!
Adam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 06:40 AM
05-13-2005 06:40 AM
Re: Need help with some shell programming ideas -- Menu driven
I don't belive it is possible to use arrow keys for selecting witout using C-code (at least not possible with shell scripts).
I have written some menu-scripts myself bot not found any way without typing something from the keyboard.
Have a look at the "select" statement in sh/ksh. It is intended for menu selections.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2005 06:56 AM
05-13-2005 06:56 AM
Re: Need help with some shell programming ideas -- Menu driven
This is a perl script that is presented to users in a menu format. I am using numbers for the menu options - you can use letters if you like, just make appropriate changes. To have the scroll capabilities with the corresponding arrows as selection items will take much, much more work. Probably more work than you want to do.
The example you posted seems mainly for printers. Attached you will find a perl script written for helpdesk personnel to allow them to do some of the functions. Note that the sudo utility is incorporated into this script - to allow the non-root users the ability to execute some lp commands.
This script can be modified to suit your needs.