Sponsored Content
Full Discussion: Bash menu opens and closes
Top Forums Shell Programming and Scripting Bash menu opens and closes Post 302938181 by sea on Thursday 12th of March 2015 05:53:18 PM
Old 03-12-2015
The 'gjb2' function as no closing bracket }.
And similar to RudiC, i'd highly recomend that the default behaviour of funtions should be return.

However, the menu function should be the only function calling others, which already is.
Also use either break or return to exit a case statement within a function.

As you already have split up the functionality to functions.
It is recomended to 'list' the functions, rather than calling 1 function which calls the other which calls another, which calls another - as one might produce unexpected behaviour.

For better readability, try to always use the same indention-blocks.
Usualy thats either 4 or 8 spaces or tabs.

hth

---------- Post updated at 22:53 ---------- Previous update was at 22:40 ----------
Since the follow up handling for all the 3 functions is identical, i'd attempt something like:
Code:
user choice 
|
|         +<--------------------------------------------------------------\
v         V                                                                \
menu +> gjb2  ->  \                                                         \
  ^  |             \                                                         \
  |  |              \                                                         \
  |  |               \                                                         ^
  |  +> mecp2 -------- +-> name -> check -> position -> parse -> add2text -> additional? -> annovar ------+
  |  |    ^           /                                                        v                          |
  |  |    +<-----------------------------------------------------------------<-+                          |
  |  |              /                                                         /                           |
  |  +> phox2b ->  /                                                         /                            |
  |  |    ^                                                                 /                             |
  |  |    +----------------------------------------------------------------/                              |
  |  |                                                                                                    |
  |  +> exit                                                                                              |
  +-------------------------------------------------------------------------------------------------------+

As on grab the data from one of the selected functions, and pass it to the follow up functions, which seem to be identical for each of the selectables...

hth
 

10 More Discussions You Might Find Interesting

1. Programming

multiuser chat server closes when one client closes. code included

I have been trying to write a very basic chat program but at the moment I am having problems getting it to be multiuser as it closes all connections when one client shutsdown. I have also been having problems trying to get the program to display a list of usernames to the clients. I have tried... (0 Replies)
Discussion started by: dooker
0 Replies

2. Shell Programming and Scripting

Bash menu script

I have a main menu quit=n while do clear echo echo "1. General system information" echo "2. Hardware utilisation information" echo "3. File management" echo "4. User information" echo "5. Information on network connectivity" echo "6. Information on processes" echo "Q.Quit" ... (3 Replies)
Discussion started by: AngelFlesh
3 Replies

3. Shell Programming and Scripting

Help regarding a bash menu script

Greetings all, I'm having some trouble writing a menu drive bash script, actually coding the menu part was not difficult however its a problem with a menu option I'm having trouble with. My menu has 5 options, when the user selects the second option, they are then prompted to enter a number from... (5 Replies)
Discussion started by: Vitrophyre
5 Replies

4. Shell Programming and Scripting

get chosen value from bash menu

Hi again :) This is just a sample whiptail menu. Works great, but have been trying to get the chosen value into a variable but failing pretty bad...its ther but unsure how to echo it out when needed #! /bin/bash #This is the menu whiptail --title "Menu example" --menu "Choose an... (9 Replies)
Discussion started by: olearydc
9 Replies

5. Red Hat

Bash: menu-complete and reverse

Hi, In the archives I found this: And this works fine. $if mode=vi "\C-0-": digit-argument TAB: menu-complete "\e But what I want is to reverse this. So I want that tab does reverse menu completion and shift tab does normal menu completion. Can anyone help me with this? Thanks (0 Replies)
Discussion started by: ozkanb
0 Replies

6. Shell Programming and Scripting

Bash Script - Whiptail Menu Help!

Hello, Been trying to build a menu with whiptail lately. However, my code doesn't seems to be working even though when i compared to other similar code they looks the same. #!/bin/bash clear whiptail --msgbox "Entering networking sub-menu" 20 78 whiptail --title Networking --menu... (8 Replies)
Discussion started by: malfolozy
8 Replies

7. Open Source

Bash menu not running

The perl command is not executing? I am trying to run the .pl in my cygwin home directory (C:\cygwin\home\cmccabe) using ${id}.txt.hg19_multianno.txt (located in the annovar directory) as the input file to be formatted and $FILENAME is the output file to be saved. The .pl is attached as... (8 Replies)
Discussion started by: cmccabe
8 Replies

8. Shell Programming and Scripting

New bash menu printing errors but closes too quickly

I am beginning to write a new version of the bash menu below. The previous version worked great and now when I start the updated bash it opens and a some lines print in the terminal and it closes quickly. I know there are errors but how can I see them or fix them, I tried set -x with the same... (12 Replies)
Discussion started by: cmccabe
12 Replies

9. Shell Programming and Scripting

Bash Menu using zenity

Hi, I'm new to bash, and have an example menu script using Zenity. It works fine if the user enters A B or C, but if the user enters nothing, I can only figure out how to exit the script. How do I get the menu to reappear if no input is selected? The script is: title="Select example"... (2 Replies)
Discussion started by: allen11
2 Replies

10. Shell Programming and Scripting

[bash] Extra tab opens

Hello everyone, This code is working right using mate-terminal but with xfce4-terminal for some reason, it open up an extra tab... Could someone please help me out to understand why this is happening? #!/bin/bash cd "$(dirname "$0")"/files tab=" --tab" title=" --title" options=()... (2 Replies)
Discussion started by: soichiro
2 Replies
DH_INSTALLMENU(1)						     Debhelper							 DH_INSTALLMENU(1)

NAME
dh_installmenu - install Debian menu files into package build directories SYNOPSIS
dh_installmenu [debhelperoptions] [-n] DESCRIPTION
dh_installmenu is a debhelper program that is responsible for installing files used by the Debian menu package into package build directories. It also automatically generates the postinst and postrm commands needed to interface with the Debian menu package. These commands are inserted into the maintainer scripts by dh_installdeb(1). FILES
debian/package.menu Debian menu files, installed into usr/share/menu/package in the package build directory. See menufile(5) for its format. debian/package.menu-method Debian menu method files, installed into etc/menu-methods/package in the package build directory. OPTIONS
-n, --no-scripts Do not modify postinst/postrm scripts. SEE ALSO
debhelper(7) update-menus(1) menufile(5) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLMENU(1)
All times are GMT -4. The time now is 09:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy