<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need help with some shell programming ideas -- Menu driven in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544405#M839261</link>
    <description>You mention no perl experience but you may be converting this script next month.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;This script can be modified to suit your needs.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 13 May 2005 13:56:33 GMT</pubDate>
    <dc:creator>Rick Garland</dc:creator>
    <dc:date>2005-05-13T13:56:33Z</dc:date>
    <item>
      <title>Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544398#M839254</link>
      <description>I have this korn shell script I am developing which will be menu driven.  However, recently I have found a few brick walls on the way:&lt;BR /&gt;&lt;BR /&gt;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").&lt;BR /&gt; &lt;BR /&gt;The "server names" come from a file that I would need to parse to get the results from.&lt;BR /&gt;The file format looks like the attached example (file attached named "parsefile_Extract.txt" -- only a sample portion example)&lt;BR /&gt;&lt;BR /&gt;Here are the few problems I have:&lt;BR /&gt;&lt;BR /&gt;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)&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;The processes file I am providing below has for:&lt;BR /&gt;service2Svr_X0|    NABEAPP|  100|  2|  2|  8|&lt;BR /&gt;&lt;BR /&gt;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):&lt;BR /&gt;&lt;BR /&gt;userapp 27142     1  0  May 11  ttyp6     0:25 service2Svr_X0 -g 2 -i 100 -u hostXX -U /apath/app/c&lt;BR /&gt;userapp 27271     1  0  May 11  ttyp6     0:24 service2Svr_X0 -g 2 -i 101 -u hostXX -U /apath/app/c&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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).&lt;BR /&gt;</description>
      <pubDate>Fri, 13 May 2005 12:42:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544398#M839254</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-05-13T12:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544399#M839255</link>
      <description>1st file attachment:&lt;BR /&gt;Menu concept...</description>
      <pubDate>Fri, 13 May 2005 12:43:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544399#M839255</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-05-13T12:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544400#M839256</link>
      <description>2nd attachment:&lt;BR /&gt;File to be parsed</description>
      <pubDate>Fri, 13 May 2005 12:44:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544400#M839256</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-05-13T12:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544401#M839257</link>
      <description>3rd attachment:&lt;BR /&gt;List of processes...</description>
      <pubDate>Fri, 13 May 2005 12:45:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544401#M839257</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-05-13T12:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544402#M839258</link>
      <description>I don't know about the arrows....but here's a "simple" menu driven script - where user selects a "letter" from the menu:&lt;BR /&gt;&lt;BR /&gt;Fri May 13 11:54:22 MDT 2005&lt;BR /&gt;&lt;BR /&gt;                         UNIX LP Support Menu&lt;BR /&gt;&lt;BR /&gt;                Please Select:&lt;BR /&gt;&lt;BR /&gt;                         a. Check printer status&lt;BR /&gt;                         b. Add Printer&lt;BR /&gt;                         c. Delete Printer&lt;BR /&gt;                         d. Disable a Print Queue&lt;BR /&gt;                         e. Enable a Print Queue&lt;BR /&gt;                         f. Backup the Spooler Configuration&lt;BR /&gt;                         g. Restore the Spooler Configuration&lt;BR /&gt;                         h. Check the Print Spooler log&lt;BR /&gt;                         i. Check the iprprtpkg log&lt;BR /&gt;                         j. Check the iprprtpkg status&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;                        x. Exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Select by pressing the letter and then ENTER&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It might give you some ideas...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Fri, 13 May 2005 12:56:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544402#M839258</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-05-13T12:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544403#M839259</link>
      <description>Thanks for the quick response Geoff, and for the attached sample (I am sure that I'll be able to use it somehow later).  I am actually following that concept for my first few menu driven screens for this program, which are required in order to set other requirements before getting to the meat of it.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Adam.</description>
      <pubDate>Fri, 13 May 2005 13:21:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544403#M839259</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2005-05-13T13:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544404#M839260</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I don't belive it is possible to use arrow keys for selecting witout using C-code (at least not possible with shell scripts).&lt;BR /&gt;&lt;BR /&gt;I have written some menu-scripts myself bot not found any way without typing something from the keyboard.&lt;BR /&gt;&lt;BR /&gt;Have a look at the "select" statement in sh/ksh. It is intended for menu selections.</description>
      <pubDate>Fri, 13 May 2005 13:40:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544404#M839260</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2005-05-13T13:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with some shell programming ideas -- Menu driven</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544405#M839261</link>
      <description>You mention no perl experience but you may be converting this script next month.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;This script can be modified to suit your needs.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 May 2005 13:56:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-some-shell-programming-ideas-menu-driven/m-p/3544405#M839261</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-05-13T13:56:33Z</dc:date>
    </item>
  </channel>
</rss>

