FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-25-2009, 09:12 PM
Grant Edwards
 
Default How to get plain ascii from "man"?

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?

--
Grant Edwards grante Yow! Am I SHOPLIFTING?
at
visi.com
 
Old 03-25-2009, 09:21 PM
Grant Edwards
 
Default How to get plain ascii from "man"?

On 2009-03-25, Grant Edwards <grante@visi.com> wrote:

> How do you get a plain ascii file (no backspacing, no escape
> sequences) out of "man"?

I know I can always drop down 2 levels and do somthing like this:

bzcat /usr/share/man/bash.1.bz2 | troff -Tascii -mandoc | grotty -bcu >man.txt

But, I'm surprised that there's no "higher level" method like
the trusty old command that worked for at least 20 years:

man bash | col -b >man.txt

--
Grant Edwards grante Yow! A can of ASPARAGUS,
at 73 pigeons, some LIVE ammo,
visi.com and a FROZEN DAQUIRI!!
 
Old 03-25-2009, 09:26 PM
Paul Hartman
 
Default How to get plain ascii from "man"?

On Wed, Mar 25, 2009 at 5:12 PM, Grant Edwards <grante@visi.com> 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.
 

Thread Tools




All times are GMT. The time now is 07:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org