Computer sciences and Information technology

UNIX/Linux – operating system2 of 7 Bonus AssignmentBASH ScriptingIntroductionFor this assignment, you need to create and submit a BASH script. I have divided the assignmentinto two parts to help you test your script. You will only submit the final application you write.Note: You must name the script file net211_assn2SubmissionYou will submit the BASH script. I will download this file and execute the script on my Linuxsystem with my own ‘database’ text file. You will receive grades based on how well your scriptimplements the application requirements. You will also receive a grade for creativity; based onusability (this includes how well you design your menu etc.)SUBMIT: net211_assgn2DUE DATE: March 3, 2016 at 11:59pmInstructionsPart One:1. Go to your Documents directory and create a subdirectory called assignment2.Change in to this new directory and create you script file here.2. You will use either vi or emacs to write your script, and test it in your terminal.Overview:Create a menu for an application that will process class list information.Your menu will present the user with the following choices:(P)rint class list(A)dd new student(S)earch for a student(D)elete a student(Q)uit3 of 7 Bonus AssignmentIt will look something like the menu in the picture below:Use the read command to read user’s input. Print the user selection on the screen.Details:For this part of assignment you need to write a simple BASH script that outputs the above menuand waits for user input. It reads the character entered by the user and prints out the character,along with the command it corresponds too. Your script should be case insensitive (i.e. it shouldwork both if a lowercase letter or an uppercase letter is entered). It should output the characterfollowed by “Invalid Option” if an incorrect letter is input. The script should then wait for furtherinput. This should continue in a loop until the user enters “Q” or “q”.The script will not perform any processing of commands yet (other than quit). We will develop itfurther part two to create our Class List application.Following is an example of what your script should do for this part:4 of 7 Bonus AssignmentTips:– Start your script with a clear command, so that your program starts with a clean screenevery time.– Use a while or until loop for repeatedly reading user input.– Use nested ifs or a case statement to print the correct output based on the input.5 of 7 Bonus AssignmentPart Two:You will continue to work with the same script file.Make the following updates to your script:1. Each of your menu choices will now call a function to perform file processing rather thansimply printing the menu option to the screen:a.

rint class list: Write a function named print_class_list that will check if afile named classlist.txt exists or not. If the file exists, it will print the file to theterminal.b. dd new student: Write a function named add_new_student that willprompt the user to enter the student number, last name, and first name of a newstudent. Append the new student to the end of the file named classlist.txt, thensort the file by student number (numerical sort). Recall the steps to sort the file(redirect the output of sort to a new file, and then rename the new file to the nameof the old file).**MAKE SURE THERE ARE NO DUPLICATE ENTRIES.STUDENT NUMBERS MUST BE UNIQUE **NOTE: The format of classlist.txt is as follows: it contains one line for eachstudent. Each line has three tab separated columns, the first is the student number,the second is the last name and the third is the first name. You must make surethat when you add a new student to the file, you use this format.Illustration 1: Printing from a file6 of 7 Bonus AssignmentIllustration 2: Appending a new student to a filec. earch for a student: Write a function named search_for_student thatwill prompt the user to enter the student number to search for. Then it will checkif a file named classlist.txt exists or not. If the file exists it will search the filefor the requested student number (use grep). If a match is found print therequested line(s) to the terminal otherwise inform the user that no such studentnumber exists in the class list. If the file does not exist, print an appropriate errormessage.Illustration 3: Searching for a student7 of 7 Bonus Assignmentd. elete a student: Write a function named delete_student that will promptthe user to enter the student number of the student to delete. Then it will check if afile named classlist.txt exists or not. If the file exists it will search the file forthe requested student number and delete it (use sed or a combination of grep andsed). If a match is found simply delete, if no match is found print an errormessage. If the file does not exist, print an appropriate error message.Illustration 4: Deleting a studentAdditional Notes:1. Use comments in your program.2. Keep it simple!3. Try to make the interface of your program as user friendly as possible. The screen shotsprovided are just here as an example of functionality, and do not necessarily representthe best layout.4. I will be using my own classlist.txt to test your program, so make sure you followthe correct format (tab separated three columns: student number, last name, first name).