Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2017 03:17:26 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Warren Block <wblock@wonkity.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: man page text output (was Re: FreeBSD 11.0-RELEASE-p7 i386 system drive imaging and migration)
Message-ID:  <20170131031726.14b97075.freebsd@edvax.de>
In-Reply-To: <alpine.BSF.2.20.1701301752200.85129@wonkity.com>
References:  <df0c81d7-fd2b-852f-4007-5fb4b24100e0@holgerdanske.com> <alpine.BSF.2.20.1701290622500.13432@wonkity.com> <516b147d-6faa-b9c0-1d8f-2313a0755211@holgerdanske.com> <alpine.BSF.2.20.1701292206450.71961@wonkity.com> <3f6c8bfb-70a4-74c2-3879-b328ecd3bb38@holgerdanske.com> <alpine.BSF.2.20.1701300816340.85129@wonkity.com> <b545887a-71f1-c218-c572-7e904ca5a485@holgerdanske.com> <alpine.BSF.2.20.1701301752200.85129@wonkity.com>

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
anymore.

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".



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170131031726.14b97075.freebsd>