From owner-freebsd-questions Fri Mar 20 04:44:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA19542 for freebsd-questions-outgoing; Fri, 20 Mar 1998 04:44:28 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from tyree.iii.co.uk (tyree.iii.co.uk [195.89.149.230]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA19536 for ; Fri, 20 Mar 1998 04:44:23 -0800 (PST) (envelope-from nik@iii.co.uk) From: nik@iii.co.uk Received: from carrig.strand.iii.co.uk (carrig.strand.iii.co.uk [192.168.7.25]) by tyree.iii.co.uk (8.8.8/8.8.8) with ESMTP id MAA04562; Fri, 20 Mar 1998 12:44:22 GMT Received: (from nik@localhost) by carrig.strand.iii.co.uk (8.8.7/8.8.7) id MAA15964; Fri, 20 Mar 1998 12:44:17 GMT Message-ID: <19980320124417.57814@iii.co.uk> Date: Fri, 20 Mar 1998 12:44:17 +0000 To: MALCOLM BOFF Cc: freebsd-questions Subject: Re: man pages References: <199803200714_MC2-3768-EB0F@compuserve.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.85e In-Reply-To: <199803200714_MC2-3768-EB0F@compuserve.com>; from MALCOLM BOFF on Fri, Mar 20, 1998 at 07:13:48AM -0500 Organization: interactive investor Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Mar 20, 1998 at 07:13:48AM -0500, MALCOLM BOFF wrote: > (This note refers to 2.2.2-RELEASE) > I have been trying to understand how man works in order that I can get some > properly formatted printouts and come up with the following conclusions. > > assuming the command 'man man' is executed then > the following command is executed :- > zcat /usr/share/man/cat1/man.1.gz > this file after decompression is not in *roff format That's right. The process of formatting a man page can be time consuming, so to save time (at the expense of disk space) formatted copies of them are kept in the /usr/(local/)share/man/cat* directories. These copies are formatted for the screen only, not for any other device. However, the first time you look at a manual page a formatted copy probably won't exist. In this case, when you type "man command" you'll see the message Formatting page, please wait... and the page will appear after a short while. A formatted copy of the page will be put in the appropriate /usr/(local/)share/man/cat* directory. So the next time you look at the man page the formatted version will come up immediately. Try it. Pick a command you've never run, perhaps 'ypwhich' or something similarly esoteric, and look at it's man page twice. The second time it will come up much faster than the first. In your example above, 'man' has checked to see if a pre-formatted copy exists. It does, so 'man' displays it straight away. > assuming that the command 'man -t man' is executed then > the following command is executed > zcat /usr/share/man/man1/man.1.gz | tbl | troff > the compressed file is in *roff format Yep. In this case you need to work on the original *roff format file, so that's used instead. > This operation by default will use the troff device 'devps' ie postscript > this does not seem to be the case however so I tried executing the command > manually as :- > > zcat /usr/share/man/man1/man.1.gz | tbl | troff -Tascii > > and expected an ascii printable but that didn't give me what I expected. No. [I'm on shakier ground here, someone feel free to correct me]. Use troff when you want output formatted for a printing device, use nroff when you want output formatted for the screen (both of these commands are emulated by groff anyway). So your command line above should be zcat /usr/share/man/man1/man.1.gz | tbl | nroff However, that will just give you the text without any of of the formatting. In order to get the formatting, you need to tell nroff to use the right macro package for the file type you're displaying. The command switch to do this is "-mmacro_package", (i.e., "-m" and then the name of the macro package with no space). For reasons that will shortly be apparent, the macro package that defines how manual pages are processed is called 'an'. This then allows you to write zcat /usr/share/man/man1/man.1.gz | tbl | nroff -man and have things work as you expect. One more thing. Some folks have enough diskspace to burn that they can afford to keep preformatted copies of all the manual pages around, so there's never any wait for 'man' to format them. If you want to do this, investigate the 'catman' program and its commented out entry in /etc/weekly. Hope that's helpful. N -- Work: nik@iii.co.uk | FreeBSD + Perl + Apache Rest: nik@nothing-going-on.demon.co.uk | Remind me again why we need Play: nik@freebsd.org | Microsoft? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message