Try running 'phone4 xyz' and see what happens. Modify your program so that if no matching name
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Applying Communication Theory For Professional Life A Practical Introduction
ISBN: 9781506315478
4th Edition
Authors: Marianne Dainton, Elaine D. Zelley
Posted Date: