Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

12. A US social security number is a 3-digit number, a hyphen, a 2-digit number,

ID: 3706645 • Letter: 1

Question

12. A US social security number is a 3-digit number, a hyphen, a 2-digit number, a hyphen and a 4- digit number. Define a regular expression to match a social security number. 13. Which of the following grep options ignores case so that you would not have to specify both upper and lower case letters in your regular expression? a.c c.I e. There is no such option so you would have to specify both upper and lower case letters if you wanted to match either case 14. We want to replace all instances the string "the Ohio State University" with "THE Ohio State University" from the file degrees.txt. What is wrong with the following sed statement? sed 's/the Ohio State University/ THE Ohio State University' degrees.txt 15. Assume data.txt co nsists of rows of employee information where each employee is denoted by last name, first name, hours worked, hourly wages. Write an awk command to output the last name and hourly wages of all employees who worked exactly 40 hours

Explanation / Answer

According to Chegg's Policy, experts are allowed to attempt first four questions in a set of more than four questions.

So I would suggest you break up the number of questions in a batch of four.

Ans 12. /^d{3}-d{2}-d{4}$/

Ans 13. grep's -i option ignores case and it even stands for case "i"nsensitive.

Ans 14. The substitute flag /g (global replacement) specifies the sed command to replace all the occurrences of the string in the line. So in this case

sed 's/the Ohio State University/THE Ohio State University/g' degrees.txt

is correct.

Ans 15. awk '$3 == 40 {print $1,$4}' data.txt