Question: Pls use Linux !!!!! In this exercise, you will write a phone script which uses the concepts we have learned in this course. You may
Pls use Linux !!!!!
In this exercise, you will write a phone script which uses the concepts we have learned in this course.
You may use this script to create contact information and lookup phone numbers or remove phone numbers as shown below.
The script you are going to write will invoke other scripts based on your selections in a menu. Lets call the top script as phone.
The phone script may have either zero, one or two parameters.
If there is no parameter when you run phone script (i.e. if you just run $ ./phone):
It should have a menu as follows:
- Enter Information
- Search by Last Name
- Search by First Name
- Search by part of last name
- Display all phone numbers
- Get the email
- Exit
Please enter the choice:
When the use enters a choice, then another script needs to be executed.
For example, when the user enters the first choice above which is: 1- enter Information, a script must run that shows the following lines:
- First Name:
- Last Name:
- Email:
- Cell Phone:
- Home phone
- Do you want to continue? Y/N :
If the user enters Y, then the code should get the information of the next person.
If you run the script with one parameter, then the code should check other information related to that parameter and display them. For example, if the parameter is the last name, the script should display the phones and email of that person. In other words, if you run ($ ./phone Smith), the script rather than showing the above menu, it should display the phones and email of Mr. Smith that you have in your contact list.
If there are two parameters, the first parameter would be an option. For example, d means delete and s means search. In other words, if you run ($ ./phone d Smith), the script must delete or remove Mr. Smith from the contact list.
Additional work: You can add some awk or sed command that enhance the phone script. Try to find out how these commands can be applied to this application.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
