1753905 Members
9676 Online
108810 Solutions
New Discussion юеВ

How to add a man page

 
Daniel Fourie
Frequent Advisor

How to add a man page

I wiuld like to know how I can add a new man page to the man search path, and if there is anything else I have to do to get it working.

Thanks
Daniel
Knowlage is Power
6 REPLIES 6
Sanjay_6
Honored Contributor

Re: How to add a man page

G. Vrijhoeven
Honored Contributor

Re: How to add a man page

Hi,

first:

HAPPY NEW YEAR

second,

here is an adittional link:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6b681012aa92d5118ff10090279cd0f9,00.html

Hope this will help,

Gideon

G. Vrijhoeven
Honored Contributor

Re: How to add a man page

Bill Hassell
Honored Contributor

Re: How to add a man page

If the man page already exists, the typical way is to extend the $MANPATH value by editing /etc/MANPATH. Many applications will install in /opt and may have a man page in /opt/app_name/man so add the manpage path to /etc/MANPATH, then test it with:

# MANPATH=$(cat /etc/MANPATH)
# man whatever..

Another technique is to use a symlink in a classic man page location such as /usr/share/man. Don't be tempted to just copy the man page to /usr/share/man as changes to your application (patches, updates, etc) may provide a new page but you'll probably forget to copy the new version. That's where a symlink works best.


Bill Hassell, sysadmin
Roger Baptiste
Honored Contributor

Re: How to add a man page

Hi,

Append the man path to the MANPATH variable.

echo $MANPATH
MANPATH=$MANPATH:
eg: MANPATH=$MANPATH:/opt/testy/man

export MANPATH

To make this permanent, add it in the .profile file.

HTh
raj
Take it easy.
T. M. Louah
Esteemed Contributor

Re: How to add a man page

to add to above use this procedure to add your own man page:
1. cp /usr/man/man1.Z/x.1 (your own directory) /x.1.Z
(where x.1 is some file in this directory)
2. cd ( to your own directory)
3. uncompress x.1.Z ( This creates a file called x.1)
4. chmod 777 x.1
5. Edit x.1 to include the information you want documented.
6. nroff -man x.1 > newname.1 (where newname is the name you want the man page to have)
7. chmod 644 newname.1
8. Compress newname.1 --- should get newname.1.Z
9. cp newname.1.Z /usr/local/man/cat*/newname.1.Z

You can either copy it to /usr/local/man/cat*, as shown above or to directory /usr/local/man/man*/newname.1.Z ( * = directory man1 to n#)


Little learning is dangerous!