README revision 1.2
11.1SmrgThis directory contains 14 shell procedures designed to carry out
21.1Smrgvarious verification and regeneration tasks on the UNIX User's
31.1SmrgManual.  The outputs of all procedures are left in files in
41.1Smrg/_u_s_r/_m_a_n/_t_m_p; `tocrc (see below) also leaves output in
51.1Smrg/_u_s_r/_m_a_n/_m_a_n_0.  By default, these procedures operate on all 8
61.1Smrgsections of the manual.  The options `-s' and `-f' are available
71.1Smrg(except in `mgrep' and `tocrc') to restrict the list of sections
81.1Smrgand/or files to be used.  For example:
91.1Smrg
101.1Smrg          ckspell -s 1 2 3 -f a\*
111.1Smrg
121.1Smrgwill check spelling in all files whose names begin with `a' in
131.1SmrgSections 1-3.  Two additional options, `-m' and `-t', can be used
141.1Smrgto change the shell procedures' idea of where the manual and its
151.1Smrg`tmp' directory reside.  For example:
161.1Smrg
171.1Smrg          list -m /usr/aman -t /usr/aman/tmp
181.1Smrg
191.1Smrgmight be meaningful if, for instance, an alternate manual is
201.1Smrglocated in /_u_s_r/_a_m_a_n.  These options are also useful when a new
211.1Smrgmanual is being built in a secluded place.
221.1Smrg
231.1SmrgNote that some of the shell procedures produce 8 result files,
241.1Smrgone for each section of the manual.  In particular, the 4 shell
251.1Smrgprocedures prefaced with `ck', which perform different types of
261.1Smrgverification, produce a unique sorted list for each section, as
271.1Smrgopposed to a file-by-file list.  This means that one must search
281.1Smrgall the files in a section (using `grep', most likely) for
291.1Smrgoccurrences of a particular string.
301.1Smrg
311.1SmrgOccasionally, some of these procedures will produce lines of
321.1Smrgspurious output.  This happens when, for instance, some text
331.1Smrglooks like a cross-reference or a file name, e.g., `array(3)' or
341.1Smrg`nroff/troff'.
351.1Smrg
361.1SmrgThe following describes these 14 procedures:
371.1Smrg
381.1Smrg1.  ckcrefs
391.1Smrg    Locates all cross-references to other manual entries and
401.1Smrg    checks to see whether the referenced pages exist.  Produces
411.1Smrg    files _b_a_d_c_r_e_f[_1-_8] containing all bad cross-references in
421.1Smrg    each section.  Also produces files _l_o_w_e_r._s_u_f[_1-_8], containing
431.1Smrg    occurrences of lower-case section suffixes, i.e., 1c, 1m, 3c,
441.1Smrg    which should be changed to upper-case (1C, 1M, 3C, etc.).
451.1Smrg
461.1Smrg2.  ckfrefs
471.1Smrg    Locates all references in the FILES portion of manual entries
481.1Smrg    and checks to see whether the referenced files exist in the
491.1Smrg    running system.  Produces files _b_a_d_f_r_e_f[_1-_8] containing
501.1Smrg    references to non-existent files.  Note that file references
511.1Smrg    under headings other than FILES are _n_o_t checked.  Temporary
521.1Smrg    files will, of course, not be found.
531.1Smrg
541.1Smrg3.  cknames
551.1Smrg    Performs various checks on the `.TH' line and the NAME
561.1Smrg    section of entries.  Note that the files produced by this
571.1Smrg    procedure contain the file names of entries that fail the
581.1Smrg    corresponding check:
591.1Smrg
601.1Smrg        Checks to see that the entry contains a `.SH NAME'
611.1Smrg        section, producing files _n_o._N_A_M_E[_1-_8].
621.1Smrg
631.2Sad        Checks the NAME section of the entry to ensure that it is
641.1Smrg        exactly one line long (multi-line NAMEs will severely
651.1Smrg        confuse `tocrc'), producing files _n_o_t._o_n_e._l_i_n_e[_1-_8].
661.1Smrg
671.1Smrg        Checks to see that the entry contains a `.TH' line,
681.1Smrg        producing files _n_o._T_H[_1-_8].
691.1Smrg
701.1Smrg        Checks that the entry name and section given on the TH
711.1Smrg        line match the file name of that entry.  For example, a
721.1Smrg        file containing `.TH GURP 1M' should be called `gurp.1m'.
731.1Smrg        Produces files _f_i_l_e._m_a_t_c_h[_1-_8].
741.1Smrg
751.1Smrg        Checks that the first name appearing on the NAME line is
761.1Smrg        the same as the entry name on the TH line (`ckso' below
771.1Smrg        assumes that this is always true).  Produces files
781.1Smrg        _n_a_m_e._o_r_d_e_r[_1-_8].
791.1Smrg
801.1Smrg4.  ckso
811.1Smrg    This procedure performs two types of verification of _n_r_o_f_f
821.1Smrg    `.so' pointers in /_u_s_r/_m_a_n/_m_a_n[_1-_8].  It first locates files
831.1Smrg    that contain only a `.so' reference to a real entry, and
841.1Smrg    checks to see whether that file (entry) exists.  Bad
851.1Smrg    references are written to the files _b_a_d_s_o[_1-_8].  Secondly,
861.1Smrg    `ckso' verifies the reverse; it locates each real entry,
871.1Smrg    looks at the NAME portion to see whether more than one name
881.1Smrg    appears there, and checks whether a file with a `.so'
891.1Smrg    reference exists for all such names other than the first.
901.1Smrg    Missing `.so' entries are written to the files _n_e_e_d_s_o[_1-_8].
911.1Smrg
921.1Smrg5.  ckspell
931.1Smrg    Utilizes _s_p_e_l_l to check for spelling errors in manual
941.1Smrg    entries.  Produces file _s_p._e_r_r_s containing a section-by-
951.1Smrg    section list of errors.  Uses file /_u_s_r/_m_a_n/_t_o_o_l_s/_s_p._i_g_n_o_r_e
961.1Smrg    to eliminate strings that appear often in the manual and are
971.1Smrg    normally flagged as errors by `spell'.
981.1Smrg
991.1Smrg6.  list
1001.1Smrg    Produces file _l_i_s_t containing a `long' listing with block
1011.1Smrg    counts (`ls -ls') for each section of the manual.
1021.1Smrg
1031.1Smrg7.  mcmp
1041.1Smrg    Compares two versions of the manual and reports what files
1051.1Smrg    are unique to each and whether or not the common files have
1061.1Smrg    changed.  If the `-d' option is given, _d_i_f_f-style listings
1071.1Smrg    are generated for each common file instead.  The `-o' option
1081.1Smrg    is used to specify the name of the second manual directory;
1091.1Smrg    /_u_s_r/_n_m_a_n is the default.  Produces files _c_m_p[_1-_8] or
1101.1Smrg    _d_i_f_f[_1-_8].
1111.1Smrg
1121.1Smrg8.  mgrep
1131.1Smrg    Searches entire manual for the patterns specified as
1141.1Smrg    arguments (i.e., `mgrep "typewriter"').  Produces file _g_r_e_p_s,
1151.1Smrg    containing section-by-section list for each pattern.
1161.1Smrg
1171.1Smrg9.  mklinks
1181.1Smrg    Creates files containing appropriate `.so' links to major
1191.1Smrg    entries where necessary.  These links point to their own
1201.1Smrg    directory; don't run this procedure anywhere else than in
1211.1Smrg    /_u_s_r/_m_a_n.  Should resolve all errors noted in _n_e_e_d_s_o[_1-_8]
1221.1Smrg    (see `ckso' above).
1231.1Smrg
1241.1Smrg10. mroff
1251.1Smrg    Utilizes the _m_a_n command to _t_r_o_f_f and typeset manual entries.
1261.1Smrg    The `-p' (yes, `-p'!) option is used to produce entries in a
1271.1Smrg    6x9 inch format, as opposed to the default 8.5x11.  Produces
1281.1Smrg    files _m_l_o_g[_1-_8] containing logs of the files that were
1291.1Smrg    processed.  _M_r_o_f_f ignores files that contain only a `.so'
1301.1Smrg    line.
1311.1Smrg
1321.1Smrg11. pgcnt
1331.1Smrg    Produces files _p_a_g_e_s[_1-_8] containing page counts for each
1341.1Smrg    entry.  Also produces _t_o_t_a_l_p_g_s containing totals for each
1351.1Smrg    section and a grand total.  The `-p' option should be used to
1361.1Smrg    count pages in the small format (see `mroff' above).  Uses
1371.1Smrg    the C program _p_a_g_e_s (compiled from _p_a_g_e_s._c).
1381.1Smrg
1391.1Smrg12. prnames
1401.1Smrg    Produces files _n_a_m_e_s[_1-_8] containing the NAME portion of each
1411.1Smrg    entry.
1421.1Smrg
1431.1Smrg13. prsynops
1441.1Smrg    Produces files _s_y_n_o_p_s[_1-_8] containing the SYNOPSIS portion of
1451.1Smrg    each entry.  A question mark means that the entry has no
1461.1Smrg    SYNOPSIS portion.
1471.1Smrg
1481.1Smrg14. tocrc
1491.1Smrg    Regenerates input for Table of Contents and Permuted Index.
1501.1Smrg    Use `tocrc all' to regenerate both from scratch, `tocrc t' to
1511.1Smrg    regenerate both from existing input files _t_o_c_x[_1-_8] in
1521.1Smrg    /_u_s_r/_m_a_n/_t_m_p, or `tocrc [1-8]' to create, in /_u_s_r/_m_a_n/_t_m_p,
1531.1Smrg    the corresponding input file _t_o_c_x[_1-_8].  The `-p' option
1541.1Smrg    should be used when preparing the table of contents and/or
1551.1Smrg    index in the small (6x9 inch) format (this option, if
1561.1Smrg    present, _m_u_s_t be the first argument to `tocrc').  See
1571.1Smrg    description in /_u_s_r/_m_a_n/_R_E_A_D._M_E of the files in
1581.1Smrg    /_u_s_r/_m_a_n/_m_a_n_0.  Uses files _b_r_e_a_k and _i_g_n_o_r_e in
1591.1Smrg    /_u_s_r/_m_a_n/_t_o_o_l_s.
1601.1Smrg
1611.1SmrgThe file ._p_a_r_a_m is described in /_u_s_r/_m_a_n/_R_E_A_D._M_E.  The files
1621.1Smrg_M._f_o_l_i_o and _M._t_a_b_s are self-explanatory.
1631.1Smrg
1641.1Smrg
1651.1Smrg
1661.1Smrg
1671.1Smrg
1681.1Smrg
1691.1Smrg
1701.1Smrg
1711.1Smrg
1721.1Smrg
1731.1Smrg
1741.1Smrg
1751.1Smrg
1761.1Smrg
1771.1Smrg
1781.1Smrg
1791.1Smrg
1801.1Smrg
1811.1Smrg
1821.1Smrg
1831.1Smrg
1841.1Smrg
1851.1Smrg
1861.1Smrg
1871.1Smrg
1881.1Smrg
1891.1Smrg
1901.1Smrg
1911.1Smrg
1921.1Smrg
1931.1Smrg
1941.1Smrg
1951.1Smrg
1961.1Smrg
1971.1Smrg
1981.1Smrg
199