Question: Unix/Lunix Programming Exercise 7 In your CWD, make a text file called phone_number.txt that contains at least the following lines. 123 456-7891 123-456-78912 (123)-456-7890 123

Unix/Lunix Programming

Exercise 7

In your CWD, make a text file called phone_number.txt that contains at least the following lines.

123 456-7891

123-456-78912

(123)-456-7890

123 456 7890

219-123-4567

(405) 456-7890

Exercise 8

Assume that a valid phone number has the format xxx-xxx-xxxx and each line in the text file does not contain leading or trailing white spaces.

Write a grep command that prints all valid phone numbers in phone_number.txt

Exercise 9

Now Assume that a valid phone number has the format (xxx) xxx-xxxx and each line in the text file does not contain leading or trailing white spaces.

Write a grep command that prints all valid phone numbers in phone_number.txt

Exercise 10

Now Assume that a valid phone number can have either the format xxx-xxx-xxxx or the format (xxx) xxx-xxxx.

Write a grep command that prints all valid phone numbers in phone_number.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!