NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using 'groff'



    Date:        Sat, 17 Jun 2023 15:18:35 +0000
    From:        Todd Gruhn <tgruhn2%gmail.com@localhost>
    Message-ID:  <CA+9Akf-fV_ig-YCt-0BvAjTU2MycHJVyAqomDmE6N=jjb=8TBg%mail.gmail.com@localhost>

  | This works:
  |     groff -man /usr/pkg/man/man1/man.1  -Tascii 2> /dev/null  |   more

I'm surprised, I would have expected it to need to be

	groff -man -Tascii /usr/pkg/man/man1/man.1 ...

though with GNU tools one can never tell what they might allow.
(the order of the -m and -T options isn't important).

  | OR ,  does 'groff -man ...' always need to have a full dir-name
  | (/usr/pkg/man/man1/* )?

It needs to be given a path to the file(s) it is to format, yes.
groff is not a manual page reader, it is a document formatter.
It works for man pages because man pages are documents, but groff
itself has no idea that what is being formatted is a manual page,
nor where such things might be stored.

Note that "-man" is not an option - -m is the option, it says
which macro package to use, "an" is the name of the manual macros,
used that way, as in practice, no-one ever does "-m an" (though you
could) with the -m arg to *roff - the macro package name is (by convention)
always given with the -m (as above, as -man in this case, there are a whole
bunch of other possibilities, for documents written for those macros,
you have to use the right macros for the document, and usually the 'm'
is considered part of the macro set name (the manuscript macros ('s')
are -ms, memorandum macros ('m') -mm, Eric's macros ('e') -me, the
manual macros ('an') -man, the doc (new form macros) 'doc' (-mdoc),
and the man/mdoc work it out and use either -man -or -mdoc, macros
("andoc") are -mandoc).

I would also suggest not redirecting stderr to /dev/null - if anything
is being printed to stderr, you (or someone) probably wants to investigate,
as it usually indicates some kind of error.

kre



Home | Main Index | Thread Index | Old Index