Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSCE 3600: Systems Programming Minor Assignment 1 - sed and gawk Due: 11:59 PM on Monday, February 6, 2023 PROGRAM DESCRIPTION: In this assignment, you

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

CSCE 3600: Systems Programming Minor Assignment 1 - sed and gawk Due: 11:59 PM on Monday, February 6, 2023 PROGRAM DESCRIPTION: In this assignment, you will write sed and gawk commands to accomplish certain requested functionality. Given the many powerful features of sed and gawk, you are provided with links to manuals and tutorials for sed and gawk to assist you in completing this assignment. Using sed a) Consider the following file called palindrome containing some 6-letter words, some of them palindromes (i.e., words that read the same backwards and forwards) and some not: toyota pullup abccba nissan redder Write a one-line sed command that prints out only the lines containing 6-letter palindromes so that after running the appropriate sed command, the following would be output to the terminal: pullup abccba redder You may write the sed command-line in the space provided below and ensure that this Word document (with your solutions) is submitted to Canvas. Answer: b) Consider the following file called phone. txt containing some arbitrary airline phone numbers as follows: (866) 8797647 (888) 4747424 (371) 6706006 (866) 2665588 (844) 415-3955 1 (800) 2372747 (800) 667-2747 Write a complete sed script called minor1. sed that will encrypt the phone data according to the following: 1. Preprocessing: a. Remove the parentheses from each phone number. b. Remove any whitespace from each phone number. c. Remove any dashes (i.e., '-') from each phone number. 2. Transposition (i.e., rearrange the order of individual characters): a. Swap the third and eighth number in each phone number. 3. Substitution (i.e., replace characters by other characters): a. Substitute each number in the phone number with random letters, being sure to use an even mix of upper- and lower-case letters. 4. Append extra data: a. Append the first 10 letters of your first and last name AFTER the third phone number in the file. If your first and last names combined are shorter than 10 letters, use letters from your middle name as well. In this file, for example, my sed script should print the following: $ sed -r -f minor1, sed phone.txt FSSFDGDStD FFttDtDFet. rDqSDqSws MarkThomps FSAESSASFF FtGtwArtAA FqDerDeqtD FqDSSDeqtD This sed script file will be submitted to Canvas. Using gawk a) Consider a list of angles in degrees, such as the following angles. txt file: Degrees 1359018604502701170180795630 2 When two angles have the same initial and terminal sides, they are called coterminal. This means that angles of 90 and 270 are coterminal as the following figure shows: In fact, all of the following angles shown in the figure below are coterminal: We want to make sure that all angle values in degrees are between 0x

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions