Assignment 5 – BASH Scripts Submit three (3) files for this assignment, one for each of the tesks below. Compress all files using zip command in your Linux terminal to obtain As5_YourName.zip file. Do not use other than ZIP compression. Submit your compressed file as an attachment in Blackboard. Task 1 (40 points): Write an AWK program that takes as its input the salary_file.txt file(you can download it from Blackboard -> Useful Links -> Files to practice AWK and SED). The salary_file.txt consists around 150 records, each record have three fields: name, salary per hour, and hours worked — fields 1, 2, and 3, respectively. Save your AWK program in a file. Name the file according to our standard convention but with .awk extension, hence name it As5_yourName.awk.Do not forget to have comments inside of your AWK file. Your AWK program should have all three segments: BEGIN, main (pattern/action), and END blocks 1.In the BEGIN segment a.print your first name and degree that you pursue (e.g., Bob, BTech in Networking and Security) b.declare/introduce/initiate variables that you are going to use in parts 2. and 3. of this Task 2.In the main block/segment, print to screen/terminal a.only names and hours worked of employees that earned more than $400.00 b.names and salary per hour of each employee with name starting with capital B, C, and the same letter that your last name starts with 3.In the END segment, print to screen/terminal a.total number of employees b.cumulative salaries earned by all employees c.name of the employee that worked the least amount of hours d.name of the file that AWK (this program) is processing Make sure to generate meaningful print statements. In other words, do not print only variables’ value but also some explanations what are you printing. Task 2 (25 points): Write a short SAD program. Name the file with your SED program according to our standard convention but with .sad extension, hence name it As5_yourName.sed. Do not forget to have comments inside of your file. You program should perform following operations on any file that I may use to test it on (see Task 3 below): 1) Remove all empty lines from the file 2) Insert your name after the last line of the file

3) Substitute all instances of CityTech with NYCCT (regardless of any combination of capital and lower case letters that are used in the word CtityTech) Task 3 (35 points): Write a BASH script that uses AWK and SED programs that you created for Task 1 and Task 2 of this assignment. For this task, create only a file with your BASH script (i.e., As5_yourName.sh). Your script should: 1.Run the AWK program that you wrote as your response to Task 1 above with salary_file.txt as the input to it (you can assume that salary_file.txt is located in the same working directory in which are your .awk and .sh files) 2.Ask a user to input a text file name with a text in it (use read command not a positional parameter). 3.Check if the user enters a valid file name a)check if a file exists b)check if a file is readable c)check if the file has extension .txt 4.If the text file exists, a)print to a screen/terminal message that validations in steps 3.a)-3.c) passed b)run the SED program that you wrote as your response to Task 2 above with the file that the user entered in 1. above c)exit your script with success (i.e., use exit 0 command) 5.If the text file does not satisfy validations of 2.a)-2.c) above a)print to a screen/terminal appropriate feedback to the user b)exit your script with failure (i.e., use exit 1 command) You should test your script by running it with your program written for Problem 1 of this assignment