Converting Sixth Edition man pages
Warren Toomey
wkt at henry.cs.adfa.oz.au
Wed Dec 30 09:43:56 AEST 1998
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
Received: (from major at localhost)
by minnie.cs.adfa.edu.au (8.9.1/8.9.1) id KAA15247
for pups-liszt; Wed, 30 Dec 1998 10:59:06 +1100 (EST)
More information about the TUHS
mailing list