Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a data file called .addr_book in your home directory. This file is a book of contacts and should contain entries for people, businesses, etc.

Create a data file called ".addr_book" in your home directory. This file is a book of contacts and should contain entries for people, businesses, etc. For example you might have an entry for me: Mike Murphy - Linux Instructor - email: murphymike@fhda.edu Note that each entry is a single line! Have at least 3 entries in the file. (Don't have any blank lines or any comment lines.) Here is another example using generic information: Firstname Lastname - jobtitle - email: lastname.firstname@emailserver.com Start a session log with the script command for your command line work. You can type exit before using interactive utilities, like vi, but remember to restart your session log when you leave vi. Use utilities to search for entries in your .addr_book file and display them. For example, one command could lookup my entry and display it, then another command could lookup your entry and display it. If you don't already have one, create a "bin" directory within your home directory Create an empty file in your bin directory called "lookup" and make it executable with appropriate permissions (so you can view or modify or execute your script). Using vi, edit the file called "lookup" that you created in step 6. You will use positional parameters in this script, so make sure to review chapter 25 in the online textbook for this step. The script should perform the following tasks:

Display a message such as "Searching for" then display the positional parameter(s) provided when the script is executed. Using positional parameters, find the entry in the "$HOME/.addr_book" file that matches the positional parameter(s) provided when the script is executed. Then, display a message such as "All Address Book Entries: " Display all lines from the file in sorted order. The output MUST be sorted. You can sort the entire line, you are not required to sort on any specific part of the line. However, if you would like an extra challenge, try sorting on the last name. The output of the lookup script might look something like this when the positional parameter "Murphy" is used when the script executes (two entries in the file are shown in this example): Searching for Murphy... Mike Murphy - Linux Instructor - email: murphymike@fhda.edu All Address Book Entries: Firstname Lastname - jobtitle - email: lastname.firstname@emailserver.com Mike Murphy - Linux Instructor - email: murphymike@fhda.edu While recording to your session log, run your script at the command line. I do not recommend running the session log while you are in vi.

Step by Step Solution

3.48 Rating (158 Votes )

There are 3 Steps involved in it

Step: 1

I have completed your assignment Please check and let me ... 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

Document Format ( 2 attachments)

PDF file Icon
6093609eb1924_23741.pdf

180 KBs PDF File

Word file Icon
6093609eb1924_23741.docx

120 KBs Word File

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

Statistics The Art And Science Of Learning From Data

Authors: Alan Agresti, Christine A. Franklin, Bernhard Klingenberg

4th Edition

133860825, 321997832, 133860914, 978-0321997838

More Books

Students also viewed these Programming questions

Question

Derive Eq. (18.33) from Eq. (18.32).

Answered: 1 week ago