Question
shell scripting, write a series of grep statements that do the following: 1. Print all lines that contain a phone number with an extension (the
shell scripting, write a series of grep statements that do the following:
1. Print all lines that contain a phone number with an extension (the letter x or X followed by four digits).
2. Print all lines that begin with three digits followed by a blank. Your answer must use the \{ and \} repetition specifier.
3. Print all lines that contain a date. Hint: this is a very simple pattern. It does not have to work for any year before 2000.
4. Print all lines containing a vowel (a, e, i, o, or u) followed by a single character followed by the same vowel again. Thus, it will find eve or adam but not vera. Hint: \( and \)
5. Print all lines that do not begin with a capital S.
6. Print all lines that contain CA in either uppercase or lowercase.
7. Print all lines that contain an email address (they have an @ in them), preceded by the line number.
8. Print all lines that do not contain the word Sep. (including the period).
9. Print all lines that contain the word de as a whole word.
Your patterns should work in any generic file of this sort. They should not be dependent upon the data in this particular file; if I add more lines of the same form to the file, your patterns should still work.
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