Advanced Exercises

 < Day Day Up > 

12.

Re-create the colors.1 and colors.2 files used in Figure 3-8 on page 52. Test your files by running diff u on them, and see whether 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. Try to consider more than one approach to answer 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.

Some mailers particularly older ones are 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 you do not know what mailer the recipient is using. Refer to the man page for uuencode, which converts a binary file to an ASCII file. 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. (If uuencode is not on your system, you can download it from rpmfind.net; it is part of the GNU sharutils package.)

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

     < Day Day Up > 


    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    ISBN: 131478230
    EAN: N/A
    Year: 2005
    Pages: 213

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