From owner-freebsd-questions@freebsd.org Tue Jan 31 02:18:14 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE64CC978B for ; Tue, 31 Jan 2017 02:18:14 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay14.qsc.de (mailrelay14.qsc.de [212.99.163.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D88C1B79 for ; Tue, 31 Jan 2017 02:18:13 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay14.qsc.de; Tue, 31 Jan 2017 03:20:20 +0100 Received: from r56.edvax.de (port-92-195-126-61.dynamic.qsc.de [92.195.126.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id AAA983CBF9; Tue, 31 Jan 2017 03:17:27 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v0V2HQAk003113; Tue, 31 Jan 2017 03:17:26 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 31 Jan 2017 03:17:26 +0100 From: Polytropon To: Warren Block 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: References: <516b147d-6faa-b9c0-1d8f-2313a0755211@holgerdanske.com> <3f6c8bfb-70a4-74c2-3879-b328ecd3bb38@holgerdanske.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay14.qsc.de with 4AFDD683426 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.1929 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 02:18:14 -0000 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, ...