From owner-freebsd-questions@freebsd.org Tue Jan 31 01:00:55 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 69DA1CC7FE4 for ; Tue, 31 Jan 2017 01:00:55 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CA0ACE5 for ; Tue, 31 Jan 2017 01:00:54 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v0V10rDs035112 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 18:00:53 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v0V10rne035109; Mon, 30 Jan 2017 18:00:53 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Mon, 30 Jan 2017 18:00:53 -0700 (MST) From: Warren Block To: David Christensen cc: freebsd-questions@freebsd.org Subject: man page text output (was Re: FreeBSD 11.0-RELEASE-p7 i386 system drive imaging and migration) In-Reply-To: Message-ID: References: <516b147d-6faa-b9c0-1d8f-2313a0755211@holgerdanske.com> <3f6c8bfb-70a4-74c2-3879-b328ecd3bb38@holgerdanske.com> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Mon, 30 Jan 2017 18:00:53 -0700 (MST) 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 01:00:55 -0000 On Mon, 30 Jan 2017, David Christensen wrote: >> >> Sure, there are control characters mixed in with the output. Easier to >> search in the pager, but this will work: >> >> man rc.conf | col -b | grep ifconfig_DEFAULT > > Okay. > > > 'man' is interleaving control characters to underline 'ifconfig_D' when > output is to STDOUT or to $PAGER: Yes. It has been doing that since the days of actual TTYs, since that was how they underlined. > Is there a way (environment variable, alias) to filter 'man' output through > 'col -b' when output is to STDOUT (rather than $PAGER)? Probably, although offhand after a long day, I'm not thinking of a short, clever way. 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.