Sponsored Content
Top Forums Shell Programming and Scripting Question on returning back a level with menus Post 302688255 by olearydc on Saturday 18th of August 2012 11:27:00 AM
Old 08-18-2012
Question on returning back a level with menus

Hi Agian

Sorry for all these questions...:

Last one for a whie, I promise

This is an example of a menu script I am using. It works OK...when I get to the 2nd menu level, if the command is issued or canceled, I would like to go back to the first menu (# MAIN SECTION)
This is NOT the menu I have created..its a bit large so I have created a smaller version below to make things easier...ish


Code:
#! /bin/bash
 
# MAIN SECTION 
activeWM=$(whiptail --backtitle "Hi" --title "PRESS YES OR NO " --radiolist "PRESS YES OR NO " 30 60 20 "ON" "PRESS YES OFF" ON "OFF" "PRESS NO" OFF 3>&1 1>&2 2>&3)
echo "User selected Ok and entered $activeWM"
 
OPTION='ON'
 
 
if [ "$OPTION" == "$activeWM" ];
then
echo "You pressed ON('$activeWM')"
whiptail --title "You pressed ON" --yesno "This is an example of a yes/no box." 8 78
 
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo "User selected Yes."
else
echo "User selected No."
fi
 
echo "(Exit status was $exitstatus)"
 
else
echo "You Pressed OFF('$activeWM')"
whiptail --title "You pressed OFF" --yesno "This is an example of a yes/no box." 8 78
 
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo "User selected Yes."
else
echo "User selected No."
fi
 
echo "(Exit status was $exitstatus)"
 
 
fi

Something like a goto back to the main section..and only then can someone cancel from the top menu,,,

Thanks again
 

10 More Discussions You Might Find Interesting

1. Programming

ncurses -> the best way to use menus

hello there, i'm exploring the curses lib and i'm having some trouble with "defining a style". to clarify: i'm creating a menu driven app and i've been thinking what's the best way to use menus: make global vars (not my favourite), creating a function which designs the menu and returns the... (2 Replies)
Discussion started by: crashnburn
2 Replies

2. UNIX for Dummies Questions & Answers

enterprise level permissions question?

Can someone give me an example of Enterprise level permissions? (4 Replies)
Discussion started by: wmosley2
4 Replies

3. UNIX for Dummies Questions & Answers

? question mark, how to get back to the root directory

hiyas I am trying to get back to the root directory: I went into MAIL directory and now I can't get back to the root directory. What are the commands... I have '?' coming up and I cannot proceed with this, HELP Cheers (1 Reply)
Discussion started by: etravels
1 Replies

4. Solaris

Difference between run level & init level

what are the major Difference Between run level & init level (2 Replies)
Discussion started by: rajaramrnb
2 Replies

5. Shell Programming and Scripting

Expression recursion level question

Hi. I am receiving this error message for the highlighted line (let "total=$total+$sales"). line 11: let: total+sales:expression recursion level exceeded (error token is "total+sales") counter=0 sales=0 total=0 echo "enter sales price" read sales total=total+sales while test $sales ; do... (5 Replies)
Discussion started by: Ccccc
5 Replies

6. AIX

EEEK - OSLEVEL -r is now reverted back to original level

Dont know what happened, my AIX 53 TL6 os just reverted back to original TL4 from whence I started this week. Is there a commad to check the ODM or kernel or something to ensure stability? (2 Replies)
Discussion started by: mrmurdock
2 Replies

7. AIX

rolling back Technology Level

Hi, is it possible to roll back currently updated Technology level ? what are steps required? Regards, Manoj (2 Replies)
Discussion started by: manoj.solaris
2 Replies

8. UNIX for Dummies Questions & Answers

General question about folder level permissions

How is the level of access on a particular folder determined? I have heard (its just hearsay so am not particularly sure of it) that the access a particular user/group has to a low level directory is also affected by the level of access granted to the user/group on its parent directories. e.g. ... (1 Reply)
Discussion started by: jawsnnn
1 Replies

9. Red Hat

SSL certificate generation on OS level or application level

We have a RHEL 5.8 server at the production level and we have a Java application on this server. I know of the SSL certificate generation at the OS (RHEL) level but it is implemented on the Java application by our development team using the Java keytool. My doubt is that is the SSL generation can... (3 Replies)
Discussion started by: RHCE
3 Replies

10. Shell Programming and Scripting

Cascading bash menus

I currently have a main menu (using whiptail) and one of the options makes an instance of another menu - sort of cascading fashion. I like to be able to terminate the current (top) menu and return to the underlying main one. I was thinking enclosing the main menu in "do... done" block. ... (0 Replies)
Discussion started by: annacreek
0 Replies
d_menu_proc(3alleg4)						  Allegro manual					      d_menu_proc(3alleg4)

NAME
d_menu_proc - Dialog procedure implementing a menu bar object. Allegro game programming library. SYNOPSIS
#include <allegro.h> int d_menu_proc(int msg, DIALOG *d, int c); DESCRIPTION
This object is a menu bar which will drop down child menus when it is clicked or if an alt+key corresponding to one of the shortcuts in the menu is pressed. It ignores a lot of the fields in the dialog structure, in particular the color is taken from the gui_*_color variables, and the width and height are calculated automatically (the w and h fields from the DIALOG are only used as a minimum size.) The dp field points to an array of menu structures: see do_menu() for more information. The top level menu will be displayed as a horizontal bar, but when child menus drop down from it they will be in the normal vertical format used by do_menu(). When a menu item is selected, the return value from the menu callback function is passed back to the dialog manager, so your callbacks should return D_O_K, D_REDRAW, or D_CLOSE. SEE ALSO
active_menu(3alleg4), gui_menu_draw_menu(3alleg4), exgui(3alleg4) Allegro version 4.4.2 d_menu_proc(3alleg4)
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy