Received: (from major@localhost)
	by minnie.cs.adfa.edu.au (8.9.1/8.9.1) id KAA15193
	for pups-liszt; Wed, 30 Dec 1998 10:42:04 +1100 (EST)
Received: from henry.cs.adfa.oz.au (henry.cs.adfa.oz.au [131.236.21.158])
	by minnie.cs.adfa.edu.au (8.9.1/8.9.1) with ESMTP id KAA15188
	for <pups@minnie.cs.adfa.oz.au>; Wed, 30 Dec 1998 10:41:57 +1100 (EST)
Received: (from wkt@localhost) by henry.cs.adfa.oz.au (8.7.5/8.7.3) id KAA23709; Wed, 30 Dec 1998 10:43:56 +1100 (EST)
From: Warren Toomey <wkt@henry.cs.adfa.oz.au>
Message-Id: <199812292343.KAA23709@henry.cs.adfa.oz.au>
Subject: Re: Converting Sixth Edition man pages
To: grog@lemis.com (Greg Lehey)
Date: Wed, 30 Dec 1998 10:43:56 +1100 (EST)
Cc: pups@minnie.cs.adfa.oz.au
In-Reply-To: <19981229123952.B12346@freebie.lemis.com> from Greg Lehey at "Dec 29, 98 12:39:52 pm"
Reply-To: wkt@cs.adfa.oz.au
X-Mailer: ELM [version 2.4ME+ PL22 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pups@minnie.cs.adfa.edu.au
Precedence: bulk

In article by Greg Lehey:
> I have the Sixth Edition man pages on my machine, but I can't do much
> with them, since they use obsolete macros.  Is there any way to
> convert them to the Seventh Edition style?
> 
> Greg

Here's a quick hack which is a start. It's a Perl script called fix:

#!/usr/bin/perl
while (<>) {
        s/^\.br/.BR/;
        if (/^\.bd/) {
            if (/\"/) {
                s/^\.bd/.B/; print; $_=".br\n";
            } else {
                s/^\.bd/.B/;
            }
        }
        s/^\.bl/.BL/;
        s/^\.it/.I/;
        s/^\.sh/.SH/;
        s/^\.th/.TH/;
        s/^\.s3/.PP/;
        s/\\\*/\\/g;
        print;
}

I've run the V6 section 1 manuals through it, then nroffed them using
GNU nroff under FreeBSD 2.2.x, and I get only the following error messages:

# for i in *.1
> do  perl /tmp/fix $i | nroff -man > /dev/null
> done
<standard input>:428: can't set diversion trap when no current diversion
<standard input>:95: can't set diversion trap when no current diversion
<standard input>:77: can't set diversion trap when no current diversion
<standard input>:40: can't set diversion trap when no current diversion
<standard input>:119: can't set diversion trap when no current diversion
<standard input>:132: normal or special character expected (got a node)
<standard input>:137: a tab character  is not allowed in an escape name
<standard input>:83: cannot use a space as a starting delimiter
<standard input>:127: can't set diversion trap when no current diversion
<standard input>:93: can't set diversion trap when no current diversion
<standard input>:75: can't set diversion trap when no current diversion
<standard input>:64: can't set diversion trap when no current diversion
<standard input>:36: can't set diversion trap when no current diversion
<standard input>:154: a tab character is not allowed before an argument
<standard input>:182: a tab character is not allowed before an argument
<standard input>:182: error: end of file while ignoring input lines
<standard input>:95: can't set diversion trap when no current diversion
<standard input>:95: can't set diversion trap when no current diversion

I haven't eyeballed the output from them all, but ls(1), sh(1), db(1)
and roff(1) look ok.

Send in any improvements!!

	Warren

