Sponsored Content
Full Discussion: Variable sub-menu issue
Top Forums Shell Programming and Scripting Variable sub-menu issue Post 302305983 by System Shock on Friday 10th of April 2009 10:54:47 AM
Old 04-10-2009
This is really hard to read without code tags and indentation, but I'd suggest you use case statements instead of a whole bunch of nested if statements -most likely the source of your problem is bad "if" nests.

I'd go for something like this:

Code:
case ${menunumber} in
        1) do something;;
        2) do something else;;
        3) show this menu
            case ${menunumber2} in
                    1) do this;;
                    2) do that;;
            esac
         *) not a choice;;
esac

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using a list menu as a variable

Hi again I have the follwing - cat ~/ABCFILE | grep "$SYSTEM" | grep "$USERNAME" What I'm looking to do is have the variable for $SYSTEM determined by the user making a selection from a numbered list. So, input 1 would be system ABC etc. I'm very puzzled as to how to go about this? Any... (3 Replies)
Discussion started by: Great Uncle Kip
3 Replies

2. UNIX for Dummies Questions & Answers

How Do I Create A Multi Line Menu Variable?

I want something that would show up basically like: Menu ----- 1) Option 1 2) Option 2 3) Option 3 Pick one: I tried menu = " Menu \r\n ----- \r\n 1)Option 1 \r\n..............etc etc etc" but that didnt work (just got the whole menu one one line, with the... (2 Replies)
Discussion started by: SoVi3t
2 Replies

3. UNIX for Dummies Questions & Answers

Input A Menu Selection In A Variable

hey all, me again....having a problem with my code, where I essentially am trying to show a menu, have the user select an option (from 1 to 5), then display which selection they picked... #!/bin/bash # A LIST OF THE ERROR MESSAGES AND THE PROPER SYNTAX: error_0="Correct amount of... (1 Reply)
Discussion started by: SoVi3t
1 Replies

4. 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

5. Shell Programming and Scripting

variable issue

Hi, I'm sure that it's a very simple issue. this is a part of my code : while read ligne do result=`ls -R ../FILES/|grep "."$ligne"$"` echo $result done<TYPE_EXT_FILES.txt the echo return nothing (as my variable is empty). I'm sure that the problem... (10 Replies)
Discussion started by: skubann
10 Replies

6. Shell Programming and Scripting

Whiptail menu, getting back the variable

Hi all Only learning so if any mistakes, let me know I am trying to create a menu box with Whiptail, taking in the variables from a txt.file called Name.txt which has just 4 names listed for now, one below each other..ie Dave John Mike Mary Bash script is below and calls the txt... (8 Replies)
Discussion started by: olearydc
8 Replies

7. 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

8. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies

9. 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
xdmxconfig(1)						      General Commands Manual						     xdmxconfig(1)

NAME
xdmxconfig - a graphical configuration tool for Xdmx configuration files SYNOPSIS
xdmxconfig [filename] DESCRIPTION
xdmxconfig reads, edits, and writes configuration files for the Xdmx server. The grammar for the configuration file is specified in the Xdmx(1) manual page. To start from scratch, create a "New Global" and specify the name and overall dimensions for the configuration. Then use "New Display" to enter more displays. If there is more than one configuration, the configuration name button will bring up a selection menu. In the right-hand pannel, the left mouse button will move the highlighted display at "tool resolution"; the middle mouse button will move the highlighted display by a single pixel (at "wall resolution"); and the right mouse button will bring up a menu allowing the highlighted display to be edited or deleted. The arrow keys will also move the highlighted display by a single pixel. BUGS
Currently, entries with the wall keyword are not editable, but will be preserved in the new output file. The tool will quit when requested by the user, even if a configuration file has not been written out (i.e., without warning). The menu interaction should be improved (menu entries that don't currently work should be greyed-out, for example). The Help button does not work. SEE ALSO
Xdmx(1), vdltodmx(1) X Version 11 xorg-server 1.12.4 xdmxconfig(1)
All times are GMT -4. The time now is 02:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy