Re: man files to text editor
[This message has also been posted to linux.debian.user.]
In article <13OhR-4aG-15@gated-at.bofh.it>, 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
>
> it will give you a text version of the man page.
That will work for small manpages. But you will not like
what it does for big ones. Here is a better way.
1. Find the manpage source.
$ whereis bash
bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz
2. Typeset it in Postscript.
# apt-get install groff gs gv
$ zcat /usr/share/man/man1/bash.1.gz | groff -Tps -mandoc - > bash.1.ps
3. Preview the Postscript. Nice, eh?
$ gv bash.1.ps
4. Make a PDF so you can print on MS-Windows, or just
send it to the printer. (I have a Laserjet 4. Maybe gs
has a driver for your printer. Try "echo devicenames == | gs")
$ gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=bash-1.pdf bash.1.ps
$ gs -sDEVICE=ljet4 -dBATCH -dNOPAUSE -sOutputFile=/dev/lp0 bash.1.ps
$ rm bash.1.ps
Notice the MS-DOS friendly PDF file name.
Cameron
Reply to: