Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Try running 'phone4 xyz' and see what happens. Modify your program so that if no matching name is found, an appropriate message is displayed: Name

Try running 'phone4 xyz' and see what happens.

Modify your program so that if no matching name is found, an appropriate message is displayed: "Name 'xyz' not in directory".

You could use an 'if' statement to check the value of $? to see if the grep command was successful (remember, '0' indicates success).

If the grep is NOT successful, then echo the message (which includes the value of $name).Give it a try.

Make sure this works with both command line arguments and with a name read in from the user, and make sure you use the message

EXACTLY as shown.

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

Applying Communication Theory For Professional Life A Practical Introduction

Authors: Marianne Dainton, Elaine D. Zelley

4th Edition

150631547X, 978-1506315478

More Books

Students also viewed these Computer Network questions

Question

4. Think of analogies that will make ideas easier to understand.

Answered: 1 week ago