Create a man page

This little exercise is to create a man page.  The goal is to take a simple online man page that is in XML and copy into a text file.  Add a couple of markups here and there, test, and validate it.

Create a manpage

Additional examples and options are available on the author's site, here.  I took that html page and created a man page for the utility.  Another first, and it turns out to be quite easy.  I may not have completely followed all the conventions, but this is what I did.

Using the vim editor, I copied and pasted the online man page into a text file, ie shc.man.1.  I added the markups .TH and .SH throughout the document. Use gzip to zip the file and move the file to an appropriate place.  I elected to move my man page to an already existing location, alternately the recommendation from some sources is /usr/local/man directory.  It's not perfect, but near perfect.  Again the first time.shcman

vi shc.man.1
gzip shc.man.1
mv shc.man.1.gz /usr/share/man/man1/
man shc
To view the man pages with color (where enabled), install most.

yum install most
echo 'export PAGER="most"' > /etc/profile.d/most.sh

shcman2There is a cool utility to list the location of the man pages.

manpath

shcman4One more step to make sure that the man page passes the proper design and to add it to the whatis database.

makewhatis
whatis shc

The expected result.

shcman3

Source(s)
http://www.datsi.fi.upm.es/~frosal/sources/shc.html
http://www.cyberciti.biz/faq/linux-unix-creating-a-manpage/
http://www.linuxhowtos.org/System/creatingman.htm