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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started