LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-16-2005, 12:17 PM   #1
gautcha
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:
#!/bin/bash
#
#
# 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, 12:28 PM   #2
secesh
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."
-- http://www.linuxquestions.org/rules.php

Here -- if the coursebook sucks, try this:
http://www.tldp.org/LDP/abs/html/

Last edited by secesh; 04-16-2005 at 12:30 PM.
 
  


Reply


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


All times are GMT -5. The time now is 02:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration