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

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!