What are you hoping to do with the file, and how much of the formatting are you trying to preserve?
So far you've been given instructions for formatted printing on a printer and outputting to several formats, including postscript, dvi, and plain text. If you are wanting something like PDF, postscript or dvi are what you want (man dvi2ps, man ps2pdf). I have a really short script I wrote at work to make a compilation PDF of a set of man pages. I can send it to you after I get in if that sounds like it is what you are after. ~Ryan On 18-Dec-08, at 6:36 AM, Iron_Man <[email protected]> wrote: > > I guess I used the wrong wording ... I am wanting to "print" or > redirect the output to a text file. Sorry about the bug in my > wording. > > On Dec 17, 9:48 pm, "Chris Miller" <[email protected]> > wrote: >> On Wed, Dec 17, 2008 at 6:27 PM, Iron_Man >> <[email protected]> wrote: >> >>> I'm hoping that there is an easy answer to this question. I am >>> trying >>> to figure out how to print out a man page for 'bc'. My first >>> attempt >>> at doing this was to use the command: >>> $ man bc > info.txt >> >>> My problem with this command is that when I opened info.txt there >>> were >>> a number of formatting oddities. Is there a way to extract the man >>> page to a text file, while keeping the formatting true to how you >>> would see the man page in the console? >> >> A quick stroll through "man man" reveals two candidates: >> >> man -t alias | lpr -Pps >> Format the manual page referenced by `alias', >> usually >> a shell manual page, into the >> default troff or groff format and pipe it to the printer >> named ps. The default output >> for groff is usually PostScript. man --help should advise >> as to which processor is bound >> to the -t option. >> >> man -l -Tdvi ./foo.1x.gz > ./foo.1x.dvi >> This command will decompress and format the nroff source >> manual page ./foo.1x.gz into a >> device independent (dvi) file. The redirection is >> necessary as the -T flag causes output >> to be directed to stdout with no pager. The output could >> be viewed with a program such >> as xdvi or further processed into PostScript using a >> program such as dvips. >> >> Although the most likely fix is this: >> >> -7, --ascii >> When viewing a pure ascii(7) manual page on a 7 bit >> terminal or terminal emulator, >> some characters may not display correctly when using >> the latin1(7) device description >> with GNU nroff. This option allows pure ascii manual >> pages to be displayed in ascii >> with the latin1 device. It will not translate any >> latin1 text. The following table >> shows the translations performed: some parts of it may >> only be displayed properly when >> using GNU nroff's latin1(7) device. >> >> Description Octal latin1 ascii >> --------------------------------------------- >> continuation hyphen 255 - - >> bullet (middle dot) 267 o o >> acute accent 264 ' ' >> multiplication sign 327 x x >> >> If the latin1 column displays correctly, your terminal >> may be set up for latin1 char- >> acters and this option is not necessary. If the latin1 >> and ascii columns are identi- >> cal, you are reading this page using this option or man >> did not format this page using >> the latin1 device description. If the latin1 column is >> missing or corrupt, you may >> need to view manual pages with this option. >> >> This option is ignored when using options -t, -H, >> -T, or -Z and may be useless for >> nroff other than GNU's. >> >> -- >> Registered Linux Addict #431495http://profile.xfire.com/ >> mrstalinman| John 3:16!http://www.fsdev.net/|http://lordsauron.wordpress.com/ >> Parents, Take Responsibility For Your Kids!http://www.whattheyplay.com/ > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
