Homework 2Due : Wednesday, February 9, Email to TAQuestion 1 (15)Describe the meaning for each regular expression below. For each expression, give 3 different examples that match the pattern.a. /^[A-Z]..$/b. /^[A-Z][a-z]*3[0-5]/c. /^[A-Za-z]*[^,][A-Za-z]*$/Question 2: (20) (Grep/egrep exercise)Given the file 'datebook' (you can download it from websitehttp://www.cs.gsu.edu/pan/csc3320/databook.txt) containing the lines ofthe following format: type first-name last-name email-addressdo the following queries:a. Print all lines containing the string CS4520.b. Print all lines where the person's first name starts with J.c. Print all lines that contain .comd. Print all lines containing an uppercase letter, followed by fourlowercase letters, a space and one uppercase letter.Question 3: (20) (sed exercise)Use the file 'datebook', do the following queries:a. Change Dumitru's name to Dima.b. Delete the first 3 line.c. Print all lines where the email address contains @student.gsu.edud. Replace the line containing "CS2010" with "NULL NULL NULL NULL".Question 4: (15) (awk exercise)Use the file 'datebook1' as database from (http://www.cs.gsu.edu/pan/csc3320/databook1.txt). The file containsthe lines of the following format:type first-name last-name email-addressDo the following queries:a. Print all email address.b. Print Dumitru's name and email address.c. Change the type with the following rule:if line number modulo 3 is 1, the type field should be changed toCS4520;if line number modulo 3 is 2, the type field be changed to CS2210;or else keep the original type field;Question 5: (10) (Exercise for transforming files)Write a command pipeline that archives and compresses the contents of a file,and writes the result to a new file. What is the corresponding commandpipeline to take this compressed file and uncompress and extract it toproduce the original file?Question 6: (10) (Exercise for searching files)Write a command pipeline to find files in a directory hierarchy (e.g. yourhome directory) that have the name pattern '*.txt" and compress them.Question 7: (10) (Exercise for sorting files)Write a command pipeline to list files in a directory hierarchy (e.g. yourhome directory) that have the name pattern '*.txt" and sort them by filesize.Question 8: (10) (Exercise for scheduling a command)Write a crontab file to send a greeting message to your mom on Christmas Eve. Show how to run the crontab
View Full Document