Tutorials
Posted on Jun 21, 2010 at 20:39
Documentation - Creating man(ual) pages
1) Create directory structure.
> mkdir -p /mystuff/share/man
Decide on a root directory where you would like to store your man files.
It's a good idea to seperate the custom man files off from the system man files.
This way the custom man files have their own location and will be easier to maintain.
Here we chose /mystuff/share/man.
2) Create all of the man subdirectories for each possible manual section number.
> mkdir /mystuff/share/man/man1
> mkdir /mystuff/share/man/man2
> mkdir /mystuff/share/man/man3
> mkdir /mystuff/share/man/man4
> mkdir /mystuff/share/man/man5
> mkdir /mystuff/share/man/man6
> mkdir /mystuff/share/man/man7
> mkdir /mystuff/share/man/man8
> mkdir /mystuff/share/man/man9
Each man file will be stored in its respective man section number directory.
3) Setup environment
> vi /etc/profile
setenv PATH "${PATH}:/mystuff/share/man"
You'll need to edit the $PATH environmental variable so the shell will know where the custom man files are located.
Edit the /etc/profile file and append onto the existing $PATH settings.
This will enable all user's shells to locate these files when they are called upon.
4) Make man page
Grab this man page template file first. Edit it and name it program.1.
Then copy it to its respective man directory. This directory will be called man1.
> cp program.1 /mystuff/share/man/man1
Now a user can access this by typing "man program" or "man 1 program" (default).