multiples menu in ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting multiples menu in ksh
Prev   Next
# 4  
Old 06-27-2010
example:

Code:
#!/bin/ksh

echo "Hello"
echo "Please select a chioce:"

PS3="Choose a number: "
CHOISE='one two three quit'
select i in $CHOISE
do
  case $i in
        one)  echo "selected one";;
        two)  echo "selected two";;
      three)  echo "selected three";;
       quit)  exit;;
          *)  echo "\nInvalid Choice\n";;
  esac
done

You can also add submenus inside a case
in Linux in the end if you add
Code:
REPLY=

it will re prompt the menu.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Gnome 3.28.3 menu item dissapears under the system menu

I installed CentOS 8 with Gnome 3.28.2 and I noticed that the "switch user" menu item disappeared from under the system menu of Gnome classic (Both X11 & Wayland). I checked google and this problem seems to have a history going back several releases of Gnome. Unfortunately, I never found a... (1 Reply)
Discussion started by: bodisha
1 Replies

2. Shell Programming and Scripting

Need help in create menu with 3 sub menu using the case command

hi all i am a newbie to this is there any examples on creating a main menu with 3 sub menu main menu -> option a , b and c a menu -> option 1 ,2 and 3 b menu -> option 1 ,2 c menu -> option 1 ,2 i am getting headache as my code kept getting unexpected EOF ---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies

3. Shell Programming and Scripting

KSH- perform a function if user selects option from menu

Hi, I have a script that copies a file from one directory to another and compiles it. What I have now is a menu that calls functions and each function compiles the file. I want to have a function that compiles the file at the end of the script if the user selects options 1-3 in the menu, but... (0 Replies)
Discussion started by: amitlib
0 Replies

4. Shell Programming and Scripting

Select ksh menu question

I am creating a Select menu with a few options and I would like to create a "better" looking interface than just this: 1) Option 1 2) Option 2 3) Option 3 Instead, I would like something like this: *********** * Cool Script * * 1) Option 1 * * 2) Option 2 * * 3) Option 3 *... (2 Replies)
Discussion started by: chipblah84
2 Replies

5. Shell Programming and Scripting

Menu in Menu script issue

Problem: I am trying to create a menu in a menu script and I am running into an issue with the calculator portion of the script. I am first presented with the ==Options Menu== which all 5 options working correctly. Now comes the fun part. I select option 1 which takes me to my ==Calculator... (1 Reply)
Discussion started by: iDdraig
1 Replies

6. Programming

multiples of 10 in java

Hi Guys, I wonder how can I determine when a given number is a multiple of another one in java. Let's say if I have 27 how can I determine whether is multiple of 5 using java programming. Thanks. (1 Reply)
Discussion started by: arizah
1 Replies

7. Programming

Pointer addresses in multiples of 32 ?

1. Why are the pointers' addresses every 32 ? 2. Am I correct in stating that memset is writing to memory that is not allocated to any of the 3 pointers ? Is it writing to memory in between the pointers ? 3. Are the 3 pointers contiguous in memory ? 4. I only allocated 10 bytes for each pointer.... (5 Replies)
Discussion started by: cyler
5 Replies

8. Shell Programming and Scripting

KSH Setting multiples variables with an array

ih all, info=$(get_Info $daemon) # $info give : # "ev20 8800 TTIOGC 12345 astos EDITEUR 0 0 . ." server=$(echo $info | cut -d" " -f1) port=$(echo $info | cut -d" " -f2) dname=$(echo $info | cut -d" " -f3) dport=$(echo... (1 Reply)
Discussion started by: wolfhurt
1 Replies

9. UNIX for Advanced & Expert Users

Menu driven using Ksh

Hi Guys, I would like to know how to write Menu driven programs using ksh. I have several script files 1.sh 2.sh 3.sh ...so on 25 files I want to create a Menu which will calls submenus. Main Menu 1. Data Entry if you press 1 again submenu 1. Order entry ... (3 Replies)
Discussion started by: krishna
3 Replies
Login or Register to Ask a Question
ppdcfile(5)							    Apple Inc.							       ppdcfile(5)

NAME
ppdcfile - cups ppd compiler source file format DESCRIPTION
The CUPS PPD compiler reads meta files that contain descriptions of one or more PPD files to be generated by ppdc. This man page provides a quick reference to the supported keywords and should be used in conjunction with the online help for CUPS. The source file format is plain ASCII text that can be edited using your favorite text editor. Comments are supported using the C (/* ... */) and C++ (// ...) comment mechanisms. Printer driver information can be grouped and shared using curly braces ({ ... }); PPD files are written when a close brace or end-of-file is seen and a PCFileName directive has been defined. Directives may be placed anywhere on a line and are followed by one or more values. The following is a list of the available directives and the values they accept: #define name value #elif {name | value} #else #endif #font name encoding "version" charset status #if {name | value} #include <filename> #include "filename" #media name width length #media "name/text" width length #po locale "filename.po" Attribute name "" value Attribute name keyword value Attribute name "keyword/text" value Choice name "code" Choice "name/text" "code" ColorDevice boolean-value ColorModel name colorspace colororder compression ColorModel "name/text" colorspace colororder compression ColorProfile resolution/mediatype gamma density matrix Copyright "text" CustomMedia name width length left bottom right top "size-code" "region-code" CustomMedia "name/text" width length left bottom right top "size-code" "region-code" Cutter boolean-value Darkness temperature name Darkness temperature "name/text" DriverType type Duplex type Filter mime-type cost program Finishing name Finishing "name/text" Font * Font name encoding "version" charset status Group name Group "name/text" HWMargins left bottom right top InputSlot position name InputSlot position "name/text" Installable name Installable "name/text" LocAttribute name "keyword/text" value ManualCopies boolean-value Manufacturer "name" MaxSize width length MediaSize name MediaType type name MediaType type "name/text" MinSize width length ModelName "name" ModelNumber number Option name type section order Option "name/text" type section order PCFileName "filename.ppd" Resolution colorspace bits-per-color row-count row-feed row-step name Resolution colorspace bits-per-color row-count row-feed row-step "name/text" SimpleColorProfile resolution/mediatype density yellow-density red-density gamma red-adjust green-adjust blue-adjust Throughput pages-per-minute UIConstraints "*Option1 *Option2" UIConstraints "*Option1 Choice1 *Option2" UIConstraints "*Option1 *Option2 Choice2" UIConstraints "*Option1 Choice1 *Option2 Choice2" VariablePaperSize boolean-value Version number SEE ALSO
ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1) http://localhost:631/help COPYRIGHT
Copyright 2007-2013 by Apple Inc. 3 December 2012 CUPS ppdcfile(5)