I don’t care for the full screen. That’s the reason why mine isn’t like that. If you want me to change it I can do it. Lab 02 - RegEx and Filters Introduction This lab assignment will measure what you...

1 answer below »
I just need screenshots of each task and I can plug it in myself




I don’t care for the full screen. That’s the reason why mine isn’t like that. If you want me to change it I can do it. Lab 02 - RegEx and Filters Introduction This lab assignment will measure what you have learned from the lecture and homework assignments, through a series of progressively more complex tasks. Each task must be completed on its own and should be completed in a separate script file. You will need to create the files yourself with the data given in the lab document. In order to be graded for credit, each task must follow the naming convention below. lab02-task##-ASURITE.sh Where ## is the 2-digit task number and ASURITE is your username in all lowercase letters. For example, a student with username sdevil completing task 03 would create a file named: lab02-task03-sdevil.sh Throughout the document, the execution may be shown using the filename script.sh. This is only for illustrative purposes to reduce the amount of unnecessary data. Unless otherwise specified, your script file will be tested on our system with the following command: bash ./lab02-task**-sdevil.sh Please ensure that your script file returns the desired output when executed with this command and submit all of your script files to the respective assignment submission on Canvas. Please submit your .sh files directly, avoid zipping them or submitting any other archived format. Task 01 (5 points) Write an piped command using cat, grep, and cut to read the provided data file, named lab0201.csv, and print the Name field from each line where the section is online Input file (lab0201.csv) Expected output of script Name,Final Grade,Section Andrew,95,online Brandon,100,online Chelsey,100,onsite Deborah,72,online Eric,65,online Frank,88,onsite Shaun,91,onsite Ninette,82,online Nguyen,80,onsite Andrew Brandon Deborah Eric Ninette Task 02 (5 points) Write a piped command using tail, cut, sort, uniq, and wc to read the provided data file, named lab0202.csv, and print the number of unique ip addresses. Input file (lab0202.csv) Expected output of script date time protocol ip-address port packet-size 2018-01-01 19:27:19 TCP 11.101.6.64 22 44 2018-04-17 01:35:12 UDP 10.101.7.69 2135 83 2018-05-05 04:26:05 UDP 11.101.6.65 2160 104 2018-08-20 15:43:16 TCP 10.101.7.64 22 113 2018-02-10 02:28:02 UDP 11.101.6.65 2089 68 2018-03-22 00:05:32 TCP 9.101.7.65 23 92 2018-04-24 19:32:47 TCP 9.100.8.65 22 93 2018-05-19 01:22:06 TCP 10.100.7.64 2107 29 2018-04-13 03:51:33 TCP 9.102.8.64 22 32 2018-08-16 21:02:36 UDP 11.100.8.65 2190 17 2018-06-27 00:44:54 UDP 11.101.6.65 2109 73 2018-01-08 07:39:00 TCP 10.101.8.65 22 74 2018-01-22 07:08:54 UDP 9.101.7.65 2165 27 2018-01-11 07:17:44 TCP 11.101.6.65 22 110 2018-01-10 13:14:41 TCP 10.101.7.64 22 89 2018-08-23 13:47:24 UDP 11.100.6.65 2187 93 2018-08-17 06:29:35 TCP 11.101.6.65 2114 66 2018-11-23 02:22:22 UDP 9.100.7.64 2142 118 2018-09-22 22:06:47 TCP 11.101.6.65 22 9 2018-04-04 09:41:43 UDP 9.102.7.64 2116 34 13 Task 03 (10 points) Write a piped command using head, tail, sort, cut, and sed to return the date of the latest event in the file in yyyy/mm/dd format Input file (lab0202.csv) Expected output of script date time protocol ip-address port packet-size 2018-01-01 19:27:19 TCP 11.101.6.64 22 44 2018-04-17 01:35:12 UDP 10.101.7.69 2135 83 2018-05-05 04:26:05 UDP 11.101.6.65 2160 104 2018-08-20 15:43:16 TCP 10.101.7.64 22 113 2018-02-10 02:28:02 UDP 11.101.6.65 2089 68 2018-03-22 00:05:32 TCP 9.101.7.65 23 92 2018-04-24 19:32:47 TCP 9.100.8.65 22 93 2018-05-19 01:22:06 TCP 10.100.7.64 2107 29 2018-04-13 03:51:33 TCP 9.102.8.64 22 32 2018-08-16 21:02:36 UDP 11.100.8.65 2190 17 2018-06-27 00:44:54 UDP 11.101.6.65 2109 73 2018-01-08 07:39:00 TCP 10.101.8.65 22 74 2018-01-22 07:08:54 UDP 9.101.7.65 2165 27 2018-01-11 07:17:44 TCP 11.101.6.65 22 110 2018-01-10 13:14:41 TCP 10.101.7.64 22 89 2018-08-23 13:47:24 UDP 11.100.6.65 2187 93 2018-08-17 06:29:35 TCP 11.101.6.65 2114 66 2018-11-23 02:22:22 UDP 9.100.7.64 2142 118 2018-09-22 22:06:47 TCP 11.101.6.65 22 9 2018-04-04 09:41:43 UDP 9.102.7.64 2116 34 2018/11/23 Task 04 (20 points) Write a piped command using grep and cut to read the provided data file, find the entries that use UDP protocol to transmit packets less than 100 bytes, and print the port number of those entries. Input file (lab0202.csv) Expected output of script date time protocol ip-address port packet-size 2018-01-01 19:27:19 TCP 11.101.6.64 22 44 2018-04-17 01:35:12 UDP 10.101.7.69 2135 83 2018-05-05 04:26:05 UDP 11.101.6.65 2160 104 2018-08-20 15:43:16 TCP 10.101.7.64 22 113 2018-02-10 02:28:02 UDP 11.101.6.65 2089 68 2018-03-22 00:05:32 TCP 9.101.7.65 23 92 2018-04-24 19:32:47 TCP 9.100.8.65 22 93 2018-05-19 01:22:06 TCP 10.100.7.64 2107 29 2018-04-13 03:51:33 TCP 9.102.8.64 22 32 2018-08-16 21:02:36 UDP 11.100.8.65 2190 17 2018-06-27 00:44:54 UDP 11.101.6.65 2109 73 2018-01-08 07:39:00 TCP 10.101.8.65 22 74 2018-01-22 07:08:54 UDP 9.101.7.65 2165 27 2018-01-11 07:17:44 TCP 11.101.6.65 22 110 2018-01-10 13:14:41 TCP 10.101.7.64 22 89 2018-08-23 13:47:24 UDP 11.100.6.65 2187 93 2018-08-17 06:29:35 TCP 11.101.6.65 2114 66 2018-11-23 02:22:22 UDP 9.100.7.64 2142 118 2018-09-22 22:06:47 TCP 11.101.6.65 22 9 2018-04-04 09:41:43 UDP 9.102.7.64 2116 34 2135 2089 2190 2109 2165 2187 2116 Note: Remember that it is ok to use grep multiple times in your piped command. Don’t try to fit everyone in one! Task 05 (20 points) Write a piped command using grep and cut to read the provided data file, find the entries that occurred in January at or before noon and used port 22, and print the IP address number of those entries. Input file (lab0202.csv) Expected output of script date time protocol ip-address port packet-size 2018-01-01 19:27:19 TCP 11.101.6.64 22 44 2018-04-17 01:35:12 UDP 10.101.7.69 2135 83 2018-05-05 04:26:05 UDP 11.101.6.65 2160 104 2018-08-20 15:43:16 TCP 10.101.7.64 22 113 2018-02-10 02:28:02 UDP 11.101.6.65 2089 68 2018-03-22 00:05:32 TCP 9.101.7.65 23 92 2018-04-24 19:32:47 TCP 9.100.8.65 22 93 2018-05-19 01:22:06 TCP 10.100.7.64 2107 29 2018-04-13 03:51:33 TCP 9.102.8.64 22 32 2018-08-16 21:02:36 UDP 11.100.8.65 2190 17 2018-06-27 00:44:54 UDP 11.101.6.65 2109 73 2018-01-08 07:39:00 TCP 10.101.8.65 22 74 2018-01-22 07:08:54 UDP 9.101.7.65 2165 27 2018-01-11 07:17:44 TCP 11.101.6.65 22 110 2018-01-10 13:14:41 TCP 10.101.7.64 22 89 2018-08-23 13:47:24 UDP 11.100.6.65 2187 93 2018-08-17 06:29:35 TCP 11.101.6.65 2114 66 2018-11-23 02:22:22 UDP 9.100.7.64 2142 118 2018-09-22 22:06:47 TCP 11.101.6.65 22 9 2018-04-04 09:41:43 UDP 9.102.7.64 2116 34 10.101.8.65 11.101.6.65 Note: for this one, you’ll need to figure out how to match before noon and exactly noon, not a minute later than 12 o’clock. Task 06 (20 points) Write a piped command using grep, sort, uniq, tail, wc, and cut to read the provided data file and return the number of unique IP addresses that match the following criteria: · IP address begins with 11 · Occurred before August 2018 · Occurred at an even numbered hour · Has a size less than or equal to 100 Input file (lab0202.csv) Expected output of script date time protocol ip-address port packet-size 2018-01-01 19:27:19 TCP 11.101.6.64 22 44 2018-04-17 01:35:12 UDP 10.101.7.69 2135 83 2018-05-05 04:26:05 UDP 11.101.6.65 2160 104 2018-08-20 15:43:16 TCP 10.101.7.64 22 113 2018-02-10 02:28:02 UDP 11.101.6.65 2089 68 2018-03-22 00:05:32 TCP 9.101.7.65 23 92 2018-04-24 19:32:47 TCP 9.100.8.65 22 93 2018-05-19 01:22:06 TCP 10.100.7.64 2107 29 2018-04-13 03:51:33 TCP 9.102.8.64 22 32 2018-08-16 21:02:36 UDP 11.100.8.65 2190 17 2018-06-27 00:44:54 UDP 11.101.6.65 2109 73 2018-01-08 07:39:00 TCP 10.101.8.65 22 74 2018-01-22 07:08:54 UDP 9.101.7.65 2165 27 2018-01-11 07:17:44 TCP 11.101.6.65 22 110 2018-01-10 13:14:41 TCP 10.101.7.64 22 89 2018-08-23 13:47:24 UDP 11.100.6.65 2187 93 2018-08-17 06:29:35 TCP 11.101.6.65 2114 66 2018-11-23 02:22:22 UDP 9.100.7.64 2142 118 2018-09-22 22:06:47 TCP 11.101.6.65 22 9 2018-04-04 09:41:43 UDP 9.102.7.64 2116 34 1 Task 07 (20 points) Write a single regular expression using grep to read the provided data file and return only the valid email addresses. Input file (lab0207.txt) Expected output of script Eat@[email protected] bmbaklavah.com [email protected] jjsibelius@asu <>?!@##$%(*&^@example.com B. M. [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] @. ahitch@@@@@example.com hfbohannon@asu. @asu.edu [email protected] [email protected] [email protected] Task EC (Up to 15 points) Regular expressions are very versatile, there’s not many situations where you can’t write a RegEx to match the string that you need. Write a string that would be very hard to match with a regular expression. Then, try to match it with a regular expression. Points will be awarded for most creative solutions.
Answered 2 days AfterAug 25, 2021

Answer To: I don’t care for the full screen. That’s the reason why mine isn’t like that. If you want me to...

Ali Asgar answered on Aug 28 2021
150 Votes
Figure 1 Task 1
Figure 2 Task 2
Figure 3 Task 3
Figure 4 Task 4
Figure 5 Task 5
Figure 6 Task 6

Figure 7 Task 7
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here