LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2008, 09:59 AM   #1
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Rep: Reputation: 31
Making menu's within menu's (function) in bash


Hi all, I'm writing a bash script which initially has a choice main menu of 10 things, this is just a case statement, each one of these 3 choices has a submenu with 2 things (if statement), I want a third option which is go back to the original menu. I've read function is able to do this but I'm finding it hard to incorperate it into my code.

If anyone doesn't quite get what i mean, its essentially this:
Quote:
main menu
1.foo
2.bar
3.foo
choose item: 2
sub menu
1.choice one
2.choice two
choose item: 1
and I'd like a third option to go back to the original menu.

Any help would be much appreciated
 
Old 03-19-2008, 10:12 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
How about using "select" statements instead? In your BaSH shell type 'help select' for inital help and searching LQ should yield examples or else the ABS will.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fluxbox ... making menu's Four Linux - Newbie 1 02-19-2007 11:38 PM
Custom K Menu's Richard Rahl Linux - General 3 09-17-2006 11:58 PM
Where are the Konqueror menu's? AliDigitaly Linux - Software 4 02-14-2005 08:38 PM
Gnome Menu's oldstinkyfish Linux - Software 0 08-07-2004 10:55 PM
Gnome 2 menu's NeTd4mN Linux - Software 1 08-06-2002 07:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration