السلام عليكم , اذا ممكن مساعدتي لعمل برنامج وظيفته التالي .. لاني بدأت بتعلم ال shell scripts منذ وقت قصير واحتاج لمساعدة في هذا السؤال
Under your home directory, create a directory called ‘project’ and underneath it do the following:
Write a shell script called mycontacts that when executed displays the following four choices:
(Your script should work on your own created contacts file called contacts)
1. Add Contact
This option allows the admin to create a new contact containing the following items:
a) Contact id: a unique number made of exactly four digits. Id numbers that
are already in use as well as id numbers that contain anything other than four digits should be continuously rejected until a unique id of the correct format is entered.
b) Full name: Full name of the contact to be added (First name and Last name).
c) Phone number: Should be in the format xxx-xxxx where each x is a digit. Phone numbers that have chars other than digits or that are not in the correct format should be continuously rejected until a phone number with the correct format is entered.
d) Email Address: This should be automatically added to each contact using the first letter of his/her first name followed by the first letter of his/her last name followed by the first and last digits of their id number. You can assume the domain name to always be birzeit.edu
( e.g. if first name is Ahmad and last name is Mursi and id number is 1234 then the email address should be am14@ birzeit.edu).
The admin should be able to add as many contacts as he/she wishes.
2. Modify Contact
This option gives the admin three choices:
a) Delete a contact
A contact entry should be deleted according to a given id number (exact number and not part of it). If the given id number does not exist, a suitable message should be displayed.
The admin should be able to delete as many contacts as he/she wishes.
b) Delete all contacts
Selecting this option deletes all the contact entries that have been added to the system.
c) Modify contact info
Selecting this option will allow the admin to select whether to modify the phone number or the last name of the contact ( Those are the only two items that are open for modifications) and make the necessary modification. New phone numbers should be checked for the correct format as mentioned in the add section above.
The admin should be able to modify/delete as many contacts as he/she wishes.
3. Search Contacts
This option gives the admin two choices:
a) Search by id number
All user information (Name, id, phone #, email address) should be displayed in a suitable and organized format according to a given id number. If the given id number does not exist, a suitable message should be displayed.
The admin should be able to search for as many contacts as he/she wishes.
b) Search by name
The admin should be given a choice to search by first name or last name and if more than one match is found for either, the info for all the contacts that match should be displayed sorted by the first name of the contact. Admins may also enter a part of a name (first or last)