Download your favorite Linux distribution at LQ ISO.
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 04-16-2005, 11:17 AM   #1
LQ Newbie
Registered: Apr 2005
Distribution: Fedora Core 3
Posts: 7

Rep: Reputation: 0
Help with script

I have to write a script for my Linux course, and I am clueless on where to go from here. I am doing and "if,then" script in the bash that when run, gives the user 5 choices to enter, and then the program executes the corresponding commands. I basically just do'nt know how to type the syntax properly. This is what my file looks like so far:
# System Info Menu
# Enables user to view common system info without having to know the commands to do so.
# Written by: Jacque Turnbow
# Date written:4/16/05
# Modified:4/16/05
# Show the menu choices
echo "___________________________________________________"
echo "Menu"
echo "___________________________________________________"
echo "These are your choices?"
echo "(1) The current date and time"
echo "(2) All users currently logged into the system"
echo "(3) The directory that you are currently working in"
echo "(4) List of files and subdirectories contained in the current directory"
echo "(5) Exit"
echo "___________________________________________________"
echo -n "Enter your choice number: "
# Read choice entered
Can someone show me how to set up the if then statements?
Old 04-16-2005, 11:28 AM   #2
Senior Member
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
here's a start: read the course book.

and here's a good quote:

"Do not expect LQ members to do your homework - you will learn much more by doing it yourself."

Here -- if the coursebook sucks, try this:

Last edited by secesh; 04-16-2005 at 11:30 AM.


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
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:47 AM.

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