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
Something like a goto back to the main section..and only then can someone cancel from the top menu,,,
I know I am doing something pretty silly..but just cant find it
I added the loop in and have done it in a few places but it just loops everything..and I normally just kill it and modify if possible
I am trying to go to the First menu and when pressing OK, where it brings up one of 2 other menus depending on user selection
and once there if I press OK to do something or cancel...I was hoping it would to revert back to the first one again so that the user can select another option ..And ONLY when I do a cancel in the first menu, the script stops...
Its hard to explain but will work with the loop a bit and hope I can get it in the right place
Looks like you have to reverse the order of done and fi at the end of the script to make it run correctly. If you want to leave the script with <cancel>, capture the exitstatus of the first whiptail cmd and evaluate:
Looks like you have to reverse the order of done and fi at the end of the script to make it run correctly. If you want to leave the script with <cancel>, capture the exitstatus of the first whiptail cmd and evaluate:
None of the systems I use have thewhiptailutility, so I can 't really test it out. But, I agree with RudiC that thedoneneeds to be moved after thefiat the end of the script.
Just by looking at the man page, I would guess that the:
should be changed to:
so the user can get out of the loop if the user got out of whipcode by hitting the ESC key and if whipcode detects an error (exit code -1), as well as by the user selecting a NO or CANCEL button (exit code 1).
This User Gave Thanks to Don Cragun For This Post:
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)
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)
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)
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)
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)
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)
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)