On Wed, Mar 25, 2009 at 5:44 PM, Grant Edwards <[email protected]> wrote:
> On 2009-03-25, Paul Hartman <[email protected]> wrote:
>> On Wed, Mar 25, 2009 at 5:12 PM, Grant Edwards <[email protected]> wrote:
>>> How do you get a plain ascii file (no backspacing, no escape
>>> sequences) out of "man"?  Running it through col or colcrt
>>> doesn't work anymore, because the default output contains ANSI
>>> color escape sequences.
>>>
>>> grotty apparently outputs ANSI color escape sequences
>>> regardless of whether or not the output is a tty and regardless
>>> of the TERM setting.
>>>
>>> Who decided that everyting in the friggin' world was an ANSI
>>> color crt even if it's not a tty and TERM isn't set?
>>
>> Edit /etc/man.conf and add -c to the commandline for TROFF,
>> NROFF and JNROFF. Then "man program | col -bf" or your method
>> of choice should work. There is a note in the man.conf
>> comments about it.
>
> That didn't work for me.  Does it work for you?
>
> I also tried manually running groff using the -c flag, and that
> didn't work either.
>
> [Actually, I didn't edit /etc/man.conf -- I copied it somewhere
> else and edited that file, then pointed man to the modified
> file using the -C option.]

Yes, it works for me. Without the -c option it put partial ANSI codes
all over, but with the -c added to man.conf piping it through col -bf
produces clean plain text output.

Reply via email to