[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: man files to text editor



On Wed, Dec 17, 2003 at 01:07:35PM -0500, Lou Losee wrote:
> * Gruessle <debian@orces.com> [2003-12-17 12:21]:
> > 
> > Is there a way I can open man files in a text editor.
> > I like to print one but have not configured my printer jet.
> > So I will email it to my other pc.
> > 
> Try man xxx | col -b > text-filename

This actually should not work, you have to tell man(1) it should send the
formatted manpage to stdout, instead of messing with the pager.
Replace `foo' with the desired program name.

$ man --pager cat foo | col -b > text-filename

Getting rid of the Latin-1 characters comes handy when mailing the
output, too.

$ man --pager cat --ascii foo | col -b > text-filename

Now we want the lines narrower than the default 80 characters (I guess
this won't work if man(1) is connected to the terminal, so the pipe is
vital here (that's why we use cat(1) as a pager--to force piping).

$ env COLUMNS=70 man --pager cat --ascii foo | col -b > text-filename

Finally, if you really want to mail it, without any further alterations,
try this (I just love to make shell one-liners ;-)):

$ env COLUMNS=70 man --pager cat --ascii foo | col -b | mail -s "Subject
of your choice" your@e-mail.address.com

Cheers,
Jan.

Attachment: pgpOCoF_1wTKL.pgp
Description: PGP signature


Reply to: