Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
Hi, here is my other assignment for the week.
Create a shell script for a telephone book application. Display a menu for the following functions.
- Add an entry----done
- Display all matches to a string----done
- Sort and display the file
- Delete all entries that match a string----done
- exit the program
Using the phone list below:
� Add a new name to the phone book file
� Display all matches to a name or phone number
� Sort the phone book file by last name
� Delete an entry
Print the results from each sequence of commands
Data File \(tabs between fields\)
Gene Smith 732 946-4691
Henry Brown 908 922-5820
Harry Crown 609 566-4515
Jim Zark 732 842-1910
Tom Mann 908 264-5321
Jack Spratt 908 264-4816
Joe Bram 609 521-4841
- Relevant commands, code, scripts, algorithms:
shell programming
- The attempts at a solution (include all code and scripts):
#!/bin/sh
# Name of phonebook
BOOK="phonebook.txt"
exit=0
while [ $exit -ne 1 ]
do
echo "operation you want?"
echo -e "add, list, find, delete, exit: "
read answer
if [ "$answer" = "add" ]
then
./add.sh
elif [ "$answer" = "list" ]
then
./list.sh
elif [ "$answer" = "find" ]
then
./find.sh
elif [ "$answer" = "delete" ]
then
./delete.sh
elif [ "$answer" = "exit" ]
then
exit=1
else
echo "command not available."
fi
done
exit 0
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Brookdale Community College - Lincroft, New Jersey - United States - Dr. Rick Bournique- COMP 145
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).