Question: DIRECTIONS A database file called datebook contains an employee data record, one per line, consisting of the following format. Employee Name : Home Phone :
DIRECTIONS
A database file called datebook contains an employee data record, one per line, consisting of the following format.
Employee Name : Home Phone : Home Address : Birthday : Salary A few notes about the record format. The employee name consists of the employee first name followed by the last name. The home phone number is in the standard North American Numbering Plan (NANP) format of xxx-xxx-xxxx (area code + Nxx-xxxx subscriber number). The birthday is in mm/dd/yy format. Record in the spaces provided the grep (not egrep) commands required to complete each problem.
GREP EXERCISE 1. Print all lines containing the string San.
---------------------------------------------------------------------------------------------------------------------------------------------------- 2. Print all lines where the person's first name starts with J.
---------------------------------------------------------------------------------------------------------------------------------------------------- 3. Print all lines ending in 700.
------------------------------------------------------------------------------------------------------------------------------------------------- 4. Print all lines that don't contain 834.
-------------------------------------------------------------------------------------------------------------------------------------------------------- 5. Print all lines where birthdays are in December (you must pattern match using mm/dd/yy format).
----------------------------------------------------------------------------------------------------------------------------------------------------------- 6. Print all lines where the phone number is in the 408 area code (you must pattern match using xxx-xxx-xxxx format).
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 7. Print all lines containing an uppercase letter, followed by four lowercase letters, a comma, a space, and one uppercase letter.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8. Print lines where the last name begins with K or k.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9. Print lines, preceded by a line number, where the salary is a six-figure number.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 10. Print lines containing Lincoln or lincoln (remember that grep is insensitive to case).
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
