Advanced Exercises


12.

Re-create the colors.1 and colors.2 files used in Figure 3-8 on page 50. Test your files by running diff -u on them. Do you get the same results as in the figure?

13.

Try giving these two commands:

$ echo cat $ cat echo 


Explain the differences between them.

14.

Repeat exercise 5 using the file phone.gz, a compressed version of the list of names and phone numbers. Consider more than one approach to each question, and explain how you made your choices.

15.

Find existing files or create files that

  1. gzip compresses by more than 80 percent.

  2. gzip compresses by less than 10 percent.

  3. get larger when compressed with gzip.

Use ls -l to determine the sizes of the files in question. Can you characterize the files in a, b, and c?

16.

Older mail programs were not able to handle binary files. Suppose that you are mailing a file that has been compressed with gzip, which produces a binary file, and the recipient is using an old mail program. Refer to the man page on uuencode, which converts a binary file to ASCII. Learn about the utility and how to use it.

  1. Convert a compressed file to ASCII, using uuencode. Is the encoded file larger or smaller than the compressed file? Explain.

  2. Would it ever make sense to use uuencode on a file before compressing it? Explain.




A Practical Guide to UNIX[r] for Mac OS[r] X Users
A Practical Guide to UNIX for Mac OS X Users
ISBN: 0131863339
EAN: 2147483647
Year: 2005
Pages: 234

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net