Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2017 03:17:26 +0100
From:      Polytropon <>
To:        Warren Block <>
Subject:   Re: man page text output (was Re: FreeBSD 11.0-RELEASE-p7 i386 system drive imaging and migration)
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <> <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Mon, 30 Jan 2017 18:00:53 -0700 (MST), Warren Block wrote:
> It used to be possible to generate "ascii" outpu with groff.  Now we 
> have mandoc, which can surely do it, but I don't see how:
>    mandoc -T ascii rc.conf
>    mandoc: rc.conf: ERROR: No such file or directory
> It might just be a missing MANPATH setting, I don't know. I'm also not 
> sure whether "ascii" output included the control characters.

The following command will generate an "ASCII rendering" of
a man page:

	% zcat /usr/share/man/en.ISO8859-1/man5/rc.conf.5.gz | groff -Tascii -mandoc

There also is a more elegant way to turn the long path name
into a nice command substitution, in case the actual manual
page _file_ is not to be specified explicitely:

	% zcat `man -w rc.conf` | groff -Tascii -mandoc

This output can be easily grepped on a "text only" basis as
it doesn't contain any control (replacement) characters

A problem can probably occur when there are entries in more
than one section for a given topic, like for example "man 1 open",
"man 2 open", and "man 3 open".

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Want to link to this message? Use this URL: <>