Trying an Existing man Page

Before you write a man page, look at an existing man page. A brief example is the man page for zless. Figure 11-5 shows the man page for zless in a terminal window.

File Edit View Terminal Tabs Help naba<® local host:-

ZLESS(l)

ZLESSd)

zless - file perusal filter for crt viewing of compressed text

SYNOPSIS

DESCRIPTION

Zless is a filter which allows examination Df compressed or plain text files one screenful at a time on a soft-copy terminal. It is the equivalent of setting the environment variable 1ESS0PEN to "Igzip -cdfq )ts", and then running less. However, enough people scorn to think that having the command zless available is inportant to bo worth providing it.

SEE ALSO

ZlESS(l)

Figure 11-5: Output of the man zless Command in a Terminal Window.

The output of the man zless command may appear garbled if the LANG environment variable is set to use UTF-8 encoding for characters and the terminal window is unable to handle the UTF-8 encoding for characters such as the hyphen. To check the setting of LANG, type locale and look at the setting for LANG. For example, on my system (in the United States), the value of LANG is as follows:

LANG=en_US.UTF-8

In this case, the language is U.S. English with UTF-8 encoding. To fix the problem, I redefine LANG as plain U.S. English (represented by the code en_US):

export LANG=en_US

To reset LANG for the entire system, I edit the /etc/sysconfig/i18n file such that it contains the line:

LANG="en_US"

If the output of the man command is garbled on your system, try making similar changes to the LANG variable to correct the problem (the exact setting of LANG depends on your language —the garbling problem should disappear if you select a language name that does not end with .UTF-8).

Returning to the example of the man page for the zless command, you don't really need to pay attention to the exact content of the man page; all you care about is the layout. Take a moment to look at the layout and notice the following points:

♦ The name of the command appears at the top of the man page. The number 1 that appears in parentheses next to the command's name denotes the section of the UNIX manual where this command belongs.

♦ The man page contains several sections, each of which appears in boldface. The text within the section is indented.

♦ In this example, the sections are NAME, SYNOPSIS, DESCRIPTION, and SEE ALSO. If you try a few more man pages, you see that some man pages have many more sections. Almost all man pages, however, have these four sections.

♦ Some text appears in boldface.

Was this article helpful?

0 0
Make Money Writing

Make Money Writing

This Report Will Show You How To Make Money By Providing Writing Services To Other Internet Marketers. Learn how to make money by writing the right way. Grab your copy of this report now and learn. Why writing is a great way to earn money. How to compete with cheap writers, even if you charge a lot more money.

Get My Free Ebook


Post a comment