- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to create a man page for my own commands?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2001 07:41 PM
тАО08-21-2001 07:41 PM
How to create a man page for my own commands?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2001 07:56 PM
тАО08-21-2001 07:56 PM
Re: How to create a man page for my own commands?
You could try the following procedure to create/modify your own man page:
1. cd /tmp
2. cp usr/man/man1.Z/attributes.1 attributes.1.Z
3. uncompress attributes.1.Z
4. chmod 777 attributes.1
5. vi attributes.1
(You can modify this file for your own command)
6. mv attributes.1 myman.1
(this will create a man for myman command)
If you prefer you could keep this in your home directory and include the path to your man page in $MANPATH variable
or if you want to place it system directories(like /usr/man/man1.Z)
7. compress myman.1
8. mv myman.1.Z myman.1
9. cp myman.1 /usr/man/man1.Z
-HTH
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2001 10:51 PM
тАО08-21-2001 10:51 PM
Re: How to create a man page for my own commands?
I was told there is a tool to convert HTML file into an ASCII and vise versa, how about this one? Is there such tool that can convert an ASCII text file into this formated file?
.\" $Header: attributes.1,v 74.2 95/05/10 21:26:47 ssa Exp $
.TA a
.TH attributes 1
.ds )H Hewlett-Packard Company
.ds ]W HP-UX Release 10.20: July 1996
.SH NAME
attributes \- describe an audio file
.SH SYNOPSIS
.CI /opt/audio/bin/attributes \0filename
.SH DESCRIPTION
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-22-2001 04:31 PM
тАО08-22-2001 04:31 PM
Re: How to create a man page for my own commands?
create man pages.
Man pages are written in roff so check the man pages
for formatting instructions. "man -k roff" should list the
variations on your server. Common variations are
groff, nroff, and troff.
The macro for formatting man pages is called 'an' so
"roff -man yourpage.1" will test format your page.
Congratulations for your interest in creating your own
man pages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-22-2001 08:28 PM
тАО08-22-2001 08:28 PM
Re: How to create a man page for my own commands?
Only nroff is available. But when I run
"nroff -man mycmd.1", it just combine a few lines into one single line. It does not add in prefix such as .TA, .ds, .SH into my text file, why? I believe these prefixes are according to the syntax of nroff and they will affect the behavior of man page. Is there any faster/automatic way to do that instead of doing this manually one line by one line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2001 05:45 AM
тАО08-23-2001 05:45 AM
Re: How to create a man page for my own commands?
I may have a much easier solution.
As you mentioned the nroff macro stuff is very cryptic.
If you have a recent Perl version installed (i.e. 5.X, not the 4.X HP furnishes its servers with, when will they finally realize the need for a current Perl?) you could generate POD (or socalled Plain Old Documentation).
The POD tokens are very easy to learn (just a handfull) and when you say "perldoc mycmd.pod" it exatly formats it like a manpage (incl. higlighting etc.).
See "perldoc perlpod" for a reference and tutorial to POD.
If however you still insist on having a real manpage from your POD file, no problem for Perl.
There exists a converter pod2man (see its POD, "perldoc pod2man")
HTH
Ralph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2001 10:03 AM
тАО08-23-2001 10:03 AM
Re: How to create a man page for my own commands?
in man(5). Type "man 5 man" to view the
documentation.
Once you've written a manpage file (start by copying
one of the system man pages), you can view it with
"nroff -man filename | more".
Most pages also use low-level nroff commands
in addition to the man(5) macros, so you'll need
to understand them as well. I suppose you could
make the analogy that "nroff -man" is to plain nroff
as LaTeX is to TeX.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2001 09:05 PM
тАО08-23-2001 09:05 PM
Re: How to create a man page for my own commands?
.C "$ /usr/local/bin/ren "netlog_*.*" "#2.netlog_#1"" But it won't produce my expected result which is $ /usr/local/bin/ren "netlog_*.*" "#2.netlog_#1", why?
Another question is I found in /usr/share/man/cat1.Z also got attributes.1 besides the one in /usr/share/man/man1.Z, why?
how about /usr/share/man/man1 ?