LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Totally Lost! Need Immediate Help! (https://www.linuxquestions.org/questions/linux-newbie-8/totally-lost-need-immediate-help-177969/)

Alekscat 05-04-2004 10:16 PM

Totally Lost! Need Immediate Help!
 
Here is my project!
It is due this Thursday:

I can figure out that I need to echo out the
first part & do a clear command up top, but
I can't figure out how to incorporate all the
material and make it show.
I was thinking an if, then statement,
but how do I add the name information to make it
come up?
Also, how do I make it do a continuous input?
I'm very lost here & have just until Thursday evening
at 7 to complete this! I have found noone locally
who can help me. I am desperate!
THANK YOU!!! Alekscat
reply to flashkittyfever@yahoo.com and/or this forum.

HERE IS MY PROJECT:

Bash Script for:

Step 1 The following menu is displayed on a clear
terminal screen when executed. Also, you must
accept either upper or lower case input from a user.

Contact List
- - - - - - - - - - -
Choose one of the following persons:

[E]vans, Roland
[J]ones, Mildred
[S]mith, Julie
[Z]ane, Morris

Step 2 -

If "E" is selected display:

Roland Evans
4321 Floppy Dr.
Hardscrabble, CO 80753
(303) 734-9874
(303) 734-9892 (fax)
revenas@zzy.net
Business partner & old friend

If "J" is selected display

Mildred Jones
249 E. 7th St., Apt. 19
New York, NY 10019
(212) 533-2814
(212) 533-9972 fax
milliej@loisaida.com
friend
Birthday: Feb. 11

If "S' is selected display

Julie Smith
123 Someplace Rd.
Richmond, VA 23219
(804) 631-2814
(804) 732-9972 fax
jsmith@richmond,com
Business Associate

If "Z" is selected display
Morris Zane
241 Roundabout Dr
Richmond, VA 23220
(804) 231-6614
(804) 321-4452 fax
mzane@rsroute.com
Business Associate

Step 3- Write the script so it accepts
continuous input, instead of terminating
after displaying just one address.

:confused: :newbie: :Pengy:

chakkerz 05-04-2004 10:59 PM

this might be silly, but if this is a school/uni assignment ... shouldn't you work this out yourself?

And it certainly doesn't look like something you are doing for work.

Alekscat 05-04-2004 11:09 PM

Believe me, I have tried. If I hadn't been trying and been totally stumped, I wouldn't have asked. I went into the class cold w/ no DOS, UNIX, LINUX, etc. & the only code I know is some HTML.
I just have no idea how to get the areas I mentioned started and I've been trying for a few weeks. I'll admit being dumb about it. Everyone else in the class has worked with others, but work and transportation situation prohibited me from hanging around & getting help. My book is really no help, as it has no example even vaguely like this, so I don't know what direction to take.

bardinjw 05-05-2004 01:14 PM

i'll give you a hint:

case
esac

look for scripting tutorial online.
almost any tutorial will give you what you need

Alekscat 05-05-2004 01:53 PM

Thanks! I was thinking echos & case or if/else, but perhaps case would be simpler.

sphynx 05-05-2004 02:09 PM

well i can't write the script for you, i have my own due. but if you want to run the script continuously you could put the whole thing in a while loop. inside you can echo out your menu, and then do a read to get the user input. it's a rather trivial script you have here. and just to help, for things like this, you should probably post in the Programming section of the forums, its likely to get the right kind of attention there. if you search online you may also find a linux user group in your area.

chakkerz 05-10-2004 03:25 AM

oh case is the way to go ...

And yes, scripting tutorials are great ... i can't ever find what i need in them though :P

Linux in a Nutshell from O'Reilly has a good Scripting section ... might be in the librarium.


All times are GMT -5. The time now is 01:18 AM.