Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Simple Address Book Search -- building A small business keeps their employee address book in a plain text file. Each line in the file

2. Simple Address Book Search -- building A small business keeps their employee address book in a plain text file. Each line in the file contains i nformation about one employee. The information on each line has three fields separated by exclamation marks (!). The fields contain the employee name, office number (building and room), and phone number. For example: Paul Allen!Sieg 134!5 - 3425 Susan Sieg!CSE 403!555 - 1212 Wilma Flintstone!Sieg 505!3 - 5367 Fred Flintstone!CSE 555!3 - 7452 Alan Turning!CSE 705!44 - 0 - 1908 - 640404 Write a short shell script that will display the names and phone numbers of pe ople in a particular building on the scree n (stdout). The script will take two arguments: the first is the name of the text fil e containing the information in the format described above; the second is the building name. For example, if the first argument to the script is the name of the file containing the above data, and the second argument is the string Sieg, the script should produce the following output: Paul Allen 5 - 3425 Wilma Flintstone 3 - 5367 These are the only two entries in the original file with offices in Sieg. (Note that Susan Siegs office is in the CSE building, so her name and phone number do not appear in the output.) Yo ur script should print the message wrong number of arguments and exit with a non - zero exit status if it is not given exactly two arguments. You do not need to check for additional errors: assume that the input file exists and can be read, etc., if the c orrect number of arguments is given. If the building (argument 2) does not exactly match a building name in the file (argument 1) , then the script should produce no output. Hints: sed, grep; a pipeline might be useful. The script should be named building ; save in your ee462 directory in your AFS file space when done.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago