Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-25-2012
Registered User
 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Please help!!

hi i have one question, i need its answer as soon as possible. please help me!.
the script should work on bash.


Q Write a script which will provide the following command line options:

-a Add a new entry
-r Remove an entry by contact name (You must confirm before removing)
-x Remove an entry by phone number (You must confirm before removing)
-l List a phone number given a name

If the user does not enter an option or an invalid option, make sure to notify appropriately.


Based on the selected entry, a file called “phonebook” in the current user’s home directory will be modified accordingly. Following is a sample of the file
phonebook
Alice Chebba
973-555-2015
Barbara Swingle
201-555-9257
Liz Stachiw
212-555-2298
Susan Goldberg
201-555-7776
Susan Topple
212-555-4932
Tony Iannino
973-555-1295


Sample command for adding a new entry:
Script.sh -a “John Hanson” 345-384-9384

Sample command for removing an entry by name:
Script.sh -r “Susan Topple”

Sample command for removing an entry by number:
Script.sh -x 212-555-2298

Sample command for listing a number by using a name:
Script.sh -l “Liz Stachiw”

Moderator's Comments:
Closed. Please repost in Homework Forum

Last edited by jim mcnamara; 04-25-2012 at 04:22 PM..
Sponsored Links
    #2  
Old 04-25-2012
...@...
 
Join Date: Feb 2004
Location: NM
Posts: 9,646
Thanks: 164
Thanked 641 Times in 618 Posts
Please repost in the Homework Forum. There are special rules for posting homework.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -4. The time now is 06:58 AM.