man page text output (was Re: FreeBSD 11.0-RELEASE-p7 i386 system drive imaging and migration)

Warren Block wblock at wonkity.com
Tue Jan 31 01:00:55 UTC 2017


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.


More information about the freebsd-questions mailing list