4.2BSD catman(8) fails on large manual +FIX

Dan Hoey hoey at NRL-AIC.ARPA
Tue Dec 4 22:42:51 AEST 1984


PROBLEM:
    /etc/catman -w gives message "?TMP" and creates an empty
    /usr/lib/whatis.

REPEAT-BY:
    /etc/catman -w did it for us.  It is dependent on the number of
    manual entries, and the size of their NAME sections.

DIAGNOSIS:
    Catman runs /usr/lib/makewhatis, which uses ed(1) to massage a
    bunch of header lines from the manuals.  Ed is running out of buffer
    space somewhere.  "?TMP" is one of those `self-explanatory message's
    from ed.

FIX:
    The same function can be performed with sed(1), and doesn't need to
    use a buffer.  I have also made it include the "local" and "new"
    manual sections in the whatis database, though I'm not sure I
    should.  In the diff listing below, replace "<TAB>" with a tab
    character.

3c3
< for i in man1 man2 man3 man4 man5 man6 man7 man8
---
> for i in man1 man2 man3 man4 man5 man6 man7 man8 manl mann
9,17c9,11
< ed - /tmp/whatis <<\!
< g/\\-/s//-/
< g/\\\*-/s//-/
< g/ VAX-11/s///
< 1,$s/.TH [^ ]* \([^ <TAB>]*\).*<TAB>\([^-]*\)/\2(\1)<TAB>/
< g/<TAB> /s//<TAB>/g
< w /tmp/whatis2
< q
< !
---
> sed -e 's/\\-/-/g' -e 's/\\\*-/-/g' -e 's/ VAX-11 / /g' \
>     -e 's/^\.TH [^ ]* \([^ <TAB>]*\).*<TAB>\([^-]*\)/\2(\1)<TAB>/' \
>     -e 's/<TAB> /<TAB>/g' /tmp/whatis >/tmp/whatis2

Dan Hoey
Navy Center for Applied Research in Artificial Intelligence
Hoey at NRL-AIC.ARPA



More information about the Comp.unix.wizards mailing list