Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-29-2008, 11:57 AM   #1
LQ Newbie
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
How do I create a Non-GUI, Script Menu

I am yet another new person to linux. I need assistance creating an non-GUI menu. I am using Slackware v12.2. What I need is the ability to have a user log into a machine and only give a menu with specific options that they can use, like: mount and un-mount a cd/dvd-rom or usb drive then copy the entire contents to the hard drive and then burn that data to a dvd. Also, the ability for them to log off/shutdown the computer. The menu I would like for them to just select the numbers then enter. What I am looking for is instruction for something close to what I want and I will try my best to figure out the rest. Thank you in advance for any assistance.

Old 12-29-2008, 12:10 PM   #2
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
You will need to look into Bash scripting, specifically loops and variables. There are a lot of guides online for advanced Bash scripting, some specifically geared to menu creation (like this one).

You might also want to look into "dialog", which is included in Slackware. Slackware uses dialog to create all of the menus for it's installer and management tools. It's prettier than bare text menus, but without all the downsides of X (higher hardware requirements, more configuration, etc, etc).
Old 12-30-2008, 08:00 AM   #3
LQ Newbie
Registered: Dec 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks MS3FGX for the quick response. I am going to try this out.

Old 12-30-2008, 02:41 PM   #4
Registered: May 2008
Posts: 47

Rep: Reputation: 15
bash (or sh or ksh) will all do this nicely. suggest the "while do; .... ; done" command for your loop; the "read" command" to get your answer.
however your problem statement suggests the need for the user to do "root" stuff. this presents another problem. you can write a simple C program and make it "set-uid" or have your user login to a root equivalent (script -> by /etc/passwd and uid = 0). The latter is dangerous, the former is more safe - especially if your program will only execute scripts in some special directory (e.g. /usr/local/sbin)
Old 12-30-2008, 04:36 PM   #5
Registered: May 2004
Location: Raleigh, NC
Distribution: Debian, Solaris, HP-UX, AIX
Posts: 208

Rep: Reputation: 35
Check out this post:

I wrote that a while ago for pretty much the same purpose.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Bash Script Help - Trying to create a variable inside script when run. webaccounts Linux - Newbie 1 06-09-2008 03:40 PM
Can someone help me create a service menu Christof999 Linux - Desktop 5 08-17-2007 01:40 PM
How can I create KDE/Gnome menu shorcut via perl script? mf1234 Programming 1 08-16-2005 06:46 PM
Script to create menu-entries for installed apps pingu Debian 4 04-06-2005 06:10 AM
Create new from context menu johnnydangerous Fedora 3 02-07-2005 05:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:28 PM.

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