HOWTO on Man Page Writing ?

HOWTO on Man Page Writing ?

Post by those who know me have no need of my nam » Thu, 15 Nov 2001 05:28:31




Quote:>For example, do a  "man sed"  and try to find just ONE example.

,----
| $ man sed
[...]
| EXAMPLES
|        Example 1: An example sed script
|
|        This sed script simulates the BSD cat -s command,  squeez-
|        ing excess blank lines from standard input.
|
|        sed -n '
|        # Write non-empty lines.
|        /./     {
|                p
|                d
|                }
|        # Write a single empty line, then look for more empty lines.
|        /^$/        p
|        # Get next line, discard the held <newline> (empty line),
|        # and look for more empty lines.
|        :Empty
|        /^$/        {
|                N
|                s/.//
|                b Empty
|                }
|        # Write the non-empty line before going back to search
|        # for the first in a set of empty lines.
|                p
|        '
[...]

--
okay, have a sig then

 
 
 

HOWTO on Man Page Writing ?

Post by Stephen Bayne » Thu, 15 Nov 2001 21:50:58



> But for most anyone else, they tend to be mighty cryptic.

I would say concise rather than cryptic.

Quote:> For example, do a  "man sed"  and try to find just ONE example.
> Is this a good example to follow?

 EXAMPLES
      Make a simple substitution in a file from the command line or from a
      shell script, changing abc to xyz:

           sed 's/abc/xyz/' file1 >file1.out

      Same as above but use shell or environment variables var1 and var2 in
      search and replacement strings:

 Hewlett-Packard Company            - 5 -  HP-UX Release 11.00: October 1997

 sed(1)                                                               sed(1)

           sed "s/$var1/$var2/" file1 >file1.out

      or

           sed 's/'$var1'/'$var2'/' file1 >file1.out

      Multiple substitutions in a single command:

           sed -e 's/abc/xyz/' -e 's/lmn/rst/' file1 >file1.out

      or

           sed -e 's/abc/xyz/' \
           -e 's/lmn/rst/' \
           file1 >file1.out

--

Philips Semiconductors Ltd                  
Southampton SO15 0DJ                        +44 (0)23 80316431
United Kingdom                              My views are my own.

 
 
 

HOWTO on Man Page Writing ?

Post by Markus Gyg » Fri, 23 Nov 2001 14:40:36



> In addition to what others suggested, let me advertise a little

> SGML-docbook-sources to man-page format.
> See http://mama.sourceforge.net

Is this compatible with Solaris >= 7 man pages? Solaris uses
a modified version of the SGML DocBook 3.0 DTD (see solbook(5),

and local file:/usr/share/lib/sgml/locale/C/dtds/solbookv2/ )
that is used by a version of the docbook-to-man tool that is
run by man (see http://www.oasis-open.org/docbook/tools/dtm/
and ftp://ftp.x.org/contrib/utilities/docbook-to-man.tar.gz
and also local on Solaris in directory file:/usr/lib/sgml/ ).

Markus

 
 
 

HOWTO on Man Page Writing ?

Post by Jan Schauman » Sat, 24 Nov 2001 00:49:15




> > In addition to what others suggested, let me advertise a little

> > SGML-docbook-sources to man-page format.
> > See http://mama.sourceforge.net

>  Is this compatible with Solaris >= 7 man pages?

I doubt it.  I don't have access to a Solaris machine (well, there's an
old Sparc sitting around here somewhere that has Solaris 2.5.1 ...).  I'll
investigate this, though - sounds interesting.

-Jan

--
Jan Schaumann <http://www.netmeister.org>

"Life," said Marvin dolefully, "loathe it or ignore it, you can't like it."