Problem

The data file that you use for your telephone number application is called corp_phones....

The data file that you use for your telephone number application is called corp_phones. In this project, you ensure that the corp_phones file is created and contains some preliminary data that is useful for testing your application as you continue to develop it. You also practice extracting information from the file by using the grep command.

To create the corp_phones file:

1. In Chapter 4, you created the corp_phones, corp_phones1, and corp_phones2 files in your home directory and performed projects to manipulate and alter data in those files. If those files are still in your home directory, use the rm command to delete them. This ensures two things: that the corp_phones file you create next has the proper information for using your new telephone number application, and that you know what is in the corp_phones file for the projects you complete in this chapter. Toward that end, some of the data you now enter is slightly different than what you used in the files you created in Chapter 4.

2. If you are in your home directory, type cd source, and press Enter. Use the pwd command to ensure you are in the source directory.

3. Use the vi or Emacs editor to create the corp_phones file.

4. Enter the following records in the file:

5. Save the file and exit the editor.

6. Type grep 219-555-4591 corp_phones and press Enter to search for a specific telephone number.

The output should look like this:

219-555-4591:Moore:Sarah:H:4500:Dept Manager:08-01-1978

7. Type grep Accountant corp_phones and press Enter to search the file for all accountants. (See Figure 6-18.)

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search