Question: UNIX Project - Shell Script Programming (Unix language) Q1. Create a script addData to add an entry in a file named familyData in
UNIX Project - Shell Script Programming (Unix language)
Q1. Create a script "addData" to add an entry in a file named familyData in the directory scriptProject. You should create the directory from your script if it doesnt exist.
The entry contains the name of the family member, his/her relation to you (example: mother, brother,..) and his/her phone number.
The user is prompted to enter the three fields in order to compose one entry. Each entry follows the format name-relation:phonenumber and is saved in familyData file.
The application should allow multiple entries to be added until the user quit the application.
In your file, ensure that the Bash shell is invoked when this script is run.
Q2. Create a script named listData" to display the data stored in familyData in an appropriate format.
Example: The record Eric-my brother:514-665-3598
Could be displayed as
Eric is my brother, can be contacted at 514-665-3598
Make use of the command awk or other Linux commands to format your output.
In your file, ensure that the Bash shell is invoked when this script is run.
Q3. Create a script "searchData" to search for record(s) matching a search criterion which could be the name, the phone or the relation criterion.
The user is prompted to enter the search criterion. Using the grep and tr commands display the matching records in an appropriate format.
The application should allow the user to search for data many times until the user quit the application.
In your file, ensure that the Bash shell is invoked when this script is run.
Q4. Create a script "deleteData" to delete a record matching a key which could be the name, the phone or the relation.
The user is prompted to enter the key. Using the sed command, delete the matching record from familydata file.
The application should allow the user to delete many records from familydata file until the user quit the application.
In your file, ensure that the Bash shell is invoked when this script is run.
Q5. Create a script phoneApp to provide the user with a menu containing five options. Each option is about executing one of the previous scripts developed in Q1 to Q4. The last option you ask the user to choose between continue or quit the application.
In your file, ensure that the Bash shell is invoked when this script is run.
All scripts and famillyData file should be in the same directory scriptProject.
What to hand in:
Snips of all scripts content (the code)
Snip of the output of cat famillyData
Snip of the output of ls -l ~/scriptProject
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
