%%s 61/4/650 %%d D 1.3 23-Apr-82 13:30:46 j 3 2 %%c Modified man.w`man.r`main to call dosyn to resolve synonyms for known %%c manual sections. %%c %%c Added man.w`man.r`dosyn to resolve synonyms. %%c %%c Modified man.w`man.fmt to reflect the addition of synonyms for the %%c standard manual sections. Also added information on the structure %%c of the known files in ~man for a given section such that users can %%c create their own manual sections. %%s 80/174/574 %%d D 1.2 23-Apr-82 12:55:24 j 2 1 %%c Eliminated man.w`manndx.sh, as it is no longer needed due to the existence %%c of `asam'. %%c %%c Updated manupd.sh to use `asam' as well as to use the new names for the %%c known directories in ~man -- sect ==> s and index ==> i. This permits %%c generally named sections of the manual to be implemented. %%c %%c Eliminated conditional code in man.w`man.r`defns,doman,tfetch. It was %%c decided that the code to handle TREE_STRUCT_FILE_SYS was superfluous. %%c This eliminated a large body of code. %%c %%c Modified man.w`man.r`main,doman,tfetch to reflect the new names in the %%c known directories, as described above. %%s 0/0/0 %%d D 1.1 25-Mar-82 12:08:57 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 #-h- cman 129 asc 25-mar-82 08:08:49 v1.1 (sw-tools v1.1) common / cman / any, table integer any # YES/NO for all entries in section pointer table # pointer to in-memory storage table #-h- cpage 151 asc 25-mar-82 08:08:50 v1.1 (sw-tools v1.1) common / cpage / pagefd, pagesz filedes pagefd # file descriptor if paging enabled, ERR if not integer pagesz # page size - DEF_PAGE_LEN/HUGE/-/ %%D 2 #-h- man.r 7887 asc 25-mar-82 08:08:52 v1.1 (sw-tools v1.1) #-h- defns 231 asc 25-mar-82 08:08:31 v1.1 (sw-tools v1.1) %%E 2 %%I 2 %%D 3 #-h- man.r 6153 asc 23-apr-82 12:41:19 j (sventek j) %%E 3 %%I 3 #-h- man.r 6813 asc 23-apr-82 13:25:30 j (sventek j) %%E 3 #-h- defns 138 asc 23-apr-82 12:25:51 j (sventek j) %%E 2 define(AVE_TOK_SIZE,10) define(MEM_SIZE,arith(256,*,AVE_TOK_SIZE)) define(RIGHT_MARGIN,80) define(DEF_PAGE_LEN,22) %%D 2 define(USE_ARCHIVES,) ifdef(TREE_STRUCT_FILE_SYS) define(SEP_STRING,"/") elsedef define(SEP_STRING,".") enddef #-h- main 1242 asc 25-mar-82 08:08:32 v1.1 (sw-tools v1.1) %%E 2 %%I 2 define(SEP_STRING,".") %%D 3 #-h- main 1239 asc 23-apr-82 12:33:10 j (sventek j) %%E 3 %%E 2 %%I 3 #-h- main 1299 asc 23-apr-82 13:13:40 j (sventek j) %%E 3 DRIVER(man) integer i, junk, pndx integer getarg, imput, isatty, ctoi filedes open pointer iminit character arg(FILENAMESIZE) include cman include cpage DS_DECL(Mem, MEM_SIZE) %%D 2 string docfil(FILENAMESIZE) "~man/sect" %%E 2 %%I 2 string docfil(FILENAMESIZE) "~man/s" %%E 2 string suffix(FILENAMESIZE) "1" string ttyfil TERMINAL_IN call query("usage: man [-] [-s
] [-a] [name] ...") if (isatty(STDOUT) == YES) { pagefd = open(ttyfil, READ) pagesz = DEF_PAGE_LEN } else { pagefd = ERR pagesz = HUGE } any = NO pndx = 1 table = iminit(MEM_SIZE, AVE_TOK_SIZE) for (i=1; getarg(i, arg, FILENAMESIZE) != EOF; i=i+1) if (arg(1) == '-') if (IS_DIGIT(arg(2))) { junk = 2 pagesz = ctoi(arg, junk) if (pagesz <= 0 & pagefd != ERR) # turn off paging { call close(pagefd) # close the file pagefd = ERR } } else if (arg(2) == 'a' | arg(2) == 'A') any = YES else if (arg(2) == 's' | arg(2) == 'S') call scopy(arg, 3, suffix, 1) else call badarg(arg) else { call fold(arg) junk = imput(table, arg) pndx = pndx + 1 } %%I 3 call dosyn(suffix) # resolve synonyms for manual sections %%E 3 call concat(docfil, suffix, docfil) if (pndx == 1 & any == NO) call dotoc(suffix, docfil) else call doman(suffix, docfil) DRETURN end #-h- allblk 179 asc 25-mar-82 08:08:33 v1.1 (sw-tools v1.1) integer function allblk(buf) character buf(ARB) integer i for (i=1; buf(i) != '@n' & buf(i) != EOS; i=i+1) if (buf(i) != ' ' & buf(i) != '@t') return(NO) return(YES) end %%D 2 #-h- doman 2707 asc 25-mar-82 08:08:34 v1.1 (sw-tools v1.1) %%E 2 %%I 2 #-h- doman 1761 asc 23-apr-82 12:33:11 j (sventek j) %%E 2 subroutine doman(suffix, file) character suffix(ARB), file(ARB), name(FILENAMESIZE), buf(MAXLINE) character gtconf integer size(2), nentry, i integer imget filedes fd filedes open include cman %%D 2 ifdef(USE_ARCHIVES) character entry(FILENAMESIZE) integer fsize(2), s1, s2, cmp integer getlin, getwrd, agethd, strcmp filedes dd linepointer ptr enddef %%E 2 %%I 2 character entry(FILENAMESIZE) integer fsize(2), s1, s2, cmp integer getlin, getwrd, agethd, strcmp filedes dd linepointer ptr %%E 2 string noman " - no manual entry available.@n" string pstr "Next entry [n => NO]? " string docdir "~man/" %%D 2 string sindex "index" %%E 2 %%I 2 string sindex "i" %%E 2 string sepr8r SEP_STRING if (any == YES) call tfetch(suffix, file) # load names of all entries call imsort(table) # sort it, just in case call imuniq(table) # strip duplicate entry names nentry = 0 # initially no entries %%D 2 ifdef(USE_ARCHIVES) fd = open(file, READ) if (fd == ERR) call cant(file) %%E 2 %%I 2 fd = open(file, READ) if (fd == ERR) call cant(file) i = 1 call stcopy(docdir, 1, name, i) call stcopy(sindex, 1, name, i) call stcopy(suffix, 1, name, i) dd = open(name, READ) if (dd == ERR) call cant(name) s1 = imget(table, name) s2 = getlin(buf, dd) repeat { if (s1 == EOF | s2 == EOF) break %%E 2 i = 1 %%D 2 call stcopy(docdir, 1, name, i) call stcopy(sindex, 1, name, i) call stcopy(suffix, 1, name, i) dd = open(name, READ) if (dd == ERR) call cant(name) s1 = imget(table, name) s2 = getlin(buf, dd) repeat %%E 2 %%I 2 junk = getwrd(buf, i, entry) cmp = strcmp(entry, name) if (cmp == -1) s2 = getlin(buf, dd) else if (cmp == 0) %%E 2 { %%D 2 if (s1 == EOF | s2 == EOF) break i = 1 junk = getwrd(buf, i, entry) cmp = strcmp(entry, name) if (cmp == -1) s2 = getlin(buf, dd) else if (cmp == 0) %%E 2 %%I 2 nentry = nentry + 1 if (nentry > 1) %%E 2 { %%D 2 nentry = nentry + 1 if (nentry > 1) %%E 2 %%I 2 if (gtconf(pstr) == 'n') %%E 2 { %%D 2 if (gtconf(pstr) == 'n') { s1 = EOF break } %%E 2 %%I 2 s1 = EOF break %%E 2 } %%D 2 call ctoptr(buf, i, ptr) call seek(ptr, fd) fsize(1) = MAX_INTEGER fsize(2) = 0 junk = agethd(fd, buf, size, fsize) call pruniq(fd, size) s1 = imget(table, name) s2 = getlin(buf, dd) %%E 2 } %%D 2 else { call putlin(name, ERROUT) call putlin(noman, ERROUT) s1 = imget(table, name) } %%E 2 %%I 2 call ctoptr(buf, i, ptr) call seek(ptr, fd) fsize(1) = MAX_INTEGER fsize(2) = 0 junk = agethd(fd, buf, size, fsize) call pruniq(fd, size) s1 = imget(table, name) s2 = getlin(buf, dd) %%E 2 } %%D 2 call close(fd) call close(dd) while (s1 != EOF & any == NO) %%E 2 %%I 2 else %%E 2 { call putlin(name, ERROUT) call putlin(noman, ERROUT) s1 = imget(table, name) } %%D 2 elsedef while (imget(table, name) != EOF) { i = 1 ifdef(TREE_STRUCT_FILE_SYS) call stcopy(file, 1, buf, i) call stcopy(sepr8r, 1, buf, i) call stcopy(name, 1, buf, i) elsedef call stcopy(docdir, 1, buf, i) call stcopy(name, 1, buf, i) call stcopy(sepr8r, 1, buf, i) call stcopy(suffix, 1, buf, i) enddef fd = open(buf, READ) if (fd == ERR) { call putlin(name, ERROUT) call putlin(noman, ERROUT) } else { size(1) = MAX_INTEGER # dummy size for agtlin size(2) = 0 nentry = nentry + 1 if (nentry > 1) { if (gtconf(pstr) == 'n') break } call pruniq(fd, size) call close(fd) } } enddef %%E 2 %%I 2 } call close(fd) call close(dd) while (s1 != EOF & any == NO) { call putlin(name, ERROUT) call putlin(noman, ERROUT) s1 = imget(table, name) } %%E 2 return end #-h- dotoc 592 asc 25-mar-82 08:08:35 v1.1 (sw-tools v1.1) subroutine dotoc(suffix, file) character suffix(ARB), file(ARB), buf(MAXLINE) integer nxtcol integer imget character name(FILENAMESIZE) include cman string intstr "Manual entries available in section " call tfetch(suffix, file) call imsort(table) call imuniq(table) call putlin(intstr, STDOUT) # header line call putlnl(suffix, STDOUT) #... call putch('@n', STDOUT) # ... call inpack(nxtcol, RIGHT_MARGIN, buf, STDOUT) # initialize packing while (imget(table, name) != EOF) call dopack(name, nxtcol, RIGHT_MARGIN, buf, STDOUT) call flpack(nxtcol, RIGHT_MARGIN, buf, STDOUT) return end #-h- gtconf 244 asc 25-mar-82 08:08:35 v1.1 (sw-tools v1.1) character function gtconf(pstr) character pstr(ARB), buf(MAXLINE), c character clower integer junk integer prompt include cpage if (pagefd != ERR) { junk = prompt(pstr, buf, pagefd) c = clower(buf(1)) } else c = 'y' return(c) end #-h- pruniq 796 asc 25-mar-82 08:08:36 v1.1 (sw-tools v1.1) ## pruniq - locate duplicate lines in archive entry on int subroutine pruniq(int, size) integer agtlin, allblk integer t, size(2), n, blk character buf(MAXLINE) character gtconf include cpage string pstr "More [n => NO]? " if (pagefd == ERR) # no duplicate stripping if not paged { while (agtlin(buf, int, size) != EOF) call putlin(buf, STDOUT) return } n = 0 t = agtlin(buf, int, size) while (t != EOF) { n = n + 1 if (n > pagesz) { if (gtconf(pstr) == 'n') break else n = 0 } call putlin(buf, STDOUT) blk = allblk(buf) t = agtlin(buf, int, size) if (blk == YES) while (t != EOF) if (allblk(buf) == NO) break else t = agtlin(buf, int, size) } while (t != EOF) t = agtlin(buf, int, size) return end %%D 2 #-h- tfetch 1312 asc 25-mar-82 08:08:37 v1.1 (sw-tools v1.1) %%E 2 %%I 2 #-h- tfetch 648 asc 23-apr-82 12:33:13 j (sventek j) %%E 2 subroutine tfetch(suffix, file) character suffix(ARB), file(ARB) character name(MAXLINE) pointer iminit integer i, junk integer imput include cman %%D 2 ifdef(USE_ARCHIVES) integer index, getlin filedes fd filedes open elsedef character suf(10) integer desc integer opendr, gdrprm, indexs enddef %%E 2 %%I 2 integer index, getlin filedes fd filedes open %%E 2 %%D 2 string sindex "index" string sect "sect" %%E 2 %%I 2 string sindex "i" string sect "s" %%E 2 string docdir "~man/" string sepr8r SEP_STRING table = iminit(MEM_SIZE, AVE_TOK_SIZE) i = 1 call stcopy(docdir, 1, name, i) %%D 2 ifdef(USE_ARCHIVES) call stcopy(sindex, 1, name, i) call stcopy(suffix, 1, name, i) fd = open(name, READ) if (fd == ERR) call error("Cannot open index for manual archive.") while (getlin(name, fd) != EOF) { i = index(name, ' ') name(i) = EOS junk = imput(table, name) } call close(fd) elsedef %%E 2 %%I 2 call stcopy(sindex, 1, name, i) call stcopy(suffix, 1, name, i) fd = open(name, READ) if (fd == ERR) call error("Cannot open index for manual archive.") while (getlin(name, fd) != EOF) { i = index(name, ' ') name(i) = EOS junk = imput(table, name) } call close(fd) %%E 2 %%D 2 ifdef(TREE_STRUCT_FILE_SYS) call stcopy(sect, 1, name, i) call stcopy(suffix, 1, name, i) elsedef call concat(sepr8r, suffix, suf) enddef if (opendr(name, desc) == ERR) call cant(name) while (gdrprm(desc, name) != EOF) { ifdef(TREE_STRUCT_FILE_SYS) junk = imput(table, name) elsedef i = indexs(name, suf) if (i > 0) { name(i) = EOS junk = imput(table, name) } enddef } call closdr(desc) enddef %%E 2 return end %%D 3 #-h- man.fmt 1972 asc 25-mar-82 08:08:55 v1.1 (sw-tools v1.1) %%E 3 %%I 3 #-h- dosyn 534 asc 23-apr-82 13:13:42 j (sventek j) ### dosyn - translate synonyms for manual sections subroutine dosyn(sect) character sect(ARB) integer equal string cmd "cmd" string prim "prim" string lib "lib" string primer "primer" string one "1" string two "2" string three "3" string four "4" call fold(sect) if (equal(sect, cmd) == YES) call strcpy(one, sect) else if (equal(sect, prim) == YES) call strcpy(two, sect) else if (equal(sect, lib) == YES) call strcpy(three, sect) else if (equal(sect, primer) == YES) call strcpy(four, sect) return end #-h- man.fmt 2965 asc 23-apr-82 13:25:34 j (sventek j) %%E 3 .so ~bin/manhdr .hd Man (1) 11-Jan-79 run off section of users manual .sy man [-] [-s
] [-a] [name] ... .ds man locates and displays the manual entries for the particular utility or function names found in the argument list. If no names are supplied, a list of those entries known to man in the section specified is supplied. .sp The manual currently consists of four sections: .sp .in +2 .ti -2 1 The writeups for the utilities are contained here. This is the default section if none is specified. %%I 3 A valid synonym for `1' is `cmd'. %%E 3 .sp .ti -2 2 The writeups for the primitive functions are contained here. The primitive functions are those which represent the virtual system calls for the Software Tools Virtual Machine. %%I 3 A valid synonym for `2' is `prim'. %%E 3 .sp .ti -2 3 The writeups for the portable library functions are found in this section. Routines for manipulating archive modules, in-memory storage, push-back stacks, pattern matching, and many others are described here. Many times a problem which you are trying to solve has been solved before, with the code for the solution appearing in the library. %%I 3 A valid synonym for `3' is `lib'. %%E 3 .sp .ti -2 4 Primers for using various utilities and function libraries appear here. %%I 3 A valid synonym for `4' is `primer'. %%E 3 .sp .in -2 %%I 3 In addition, site-dependent sections can be added by creating the necessary known files in ~man. The section on FILES below describes the structure of the known files. .sp %%E 3 If the -a flag is specified, all of the manual entries for the particular section are displayed on standard output. .sp When displaying to the terminal, excess white space is removed from the entries. The output is also paged when to a terminal, with the default page length being 22 lines. This value may be changed through the use of the '-' option. Specifying a pagelength of 0 turns the paging off. When in paging mode, the user will be asked if the next screenful of the current entry is desired. In addition, if more than one entry was requested, the user is asked if the next entry is desired. .fl %%D 3 Accesses the directory and files containing user documents. %%E 3 %%I 3 Accesses the known files for each section in the ~man directory. .sp Each section consists of two files in ~man: .sp .in +2 .ti -2 * s is an archive of the `format' output files for each entry, with each archive module having the name of the entry. For example, s1 has the entries for the commands, with the entry for `ar' being ar. .sp .ti -2 * i is an index of the s-file above generated by `asam'. This index must be sorted, and is generated by .sp asam | sort >i .sp .in -2 There is no restriction of `' to integers, such that if one wishes to create a local man section, simply archive the formatted entries in ~man/slocal and generate the index in ~man/slocal. %%E 3 .sa The tool 'intro'; the Unix command 'man' .di A message is printed if the entry specified by 'name' cannot be located. .au Joe Sventek #-h- bdman.r 5523 asc 25-mar-82 10:50:29 v1.1 (sw-tools v1.1) #-h- defns 115 asc 25-mar-82 10:50:08 v1.1 (sw-tools v1.1) define(AVE_TOK_SIZE,10) define(MEM_SIZE,arith(256,*,AVE_TOK_SIZE)) define(RIGHT_MARGIN,80) define(DEF_PAGE_LEN,22) #-h- main 1242 asc 25-mar-82 10:50:10 v1.1 (sw-tools v1.1) DRIVER(man) integer i, junk, pndx integer getarg, imput, isatty, ctoi filedes open pointer iminit character arg(FILENAMESIZE) include cman include cpage DS_DECL(Mem, MEM_SIZE) string docfil(FILENAMESIZE) "~man/sect" string suffix(FILENAMESIZE) "1" string ttyfil TERMINAL_IN call query("usage: man [-] [-s
] [-a] [name] ...") if (isatty(STDOUT) == YES) { pagefd = open(ttyfil, READ) pagesz = DEF_PAGE_LEN } else { pagefd = ERR pagesz = HUGE } any = NO pndx = 1 table = iminit(MEM_SIZE, AVE_TOK_SIZE) for (i=1; getarg(i, arg, FILENAMESIZE) != EOF; i=i+1) if (arg(1) == '-') if (IS_DIGIT(arg(2))) { junk = 2 pagesz = ctoi(arg, junk) if (pagesz <= 0 & pagefd != ERR) # turn off paging { call close(pagefd) # close the file pagefd = ERR } } else if (arg(2) == 'a' | arg(2) == 'A') any = YES else if (arg(2) == 's' | arg(2) == 'S') call scopy(arg, 3, suffix, 1) else call badarg(arg) else { call fold(arg) junk = imput(table, arg) pndx = pndx + 1 } call concat(docfil, suffix, docfil) if (pndx == 1 & any == NO) call dotoc(suffix, docfil) else call doman(suffix, docfil) DRETURN end #-h- allblk 179 asc 25-mar-82 10:50:11 v1.1 (sw-tools v1.1) integer function allblk(buf) character buf(ARB) integer i for (i=1; buf(i) != '@n' & buf(i) != EOS; i=i+1) if (buf(i) != ' ' & buf(i) != '@t') return(NO) return(YES) end #-h- doman 1259 asc 25-mar-82 10:50:12 v1.1 (sw-tools v1.1) subroutine doman(suffix, file) character suffix(ARB), file(ARB), name(MAXLINE), buf(MAXLINE) character gtconf integer fsize(2), s1, s2, size(2), cmp, nentry integer nxtnam, agethd, strcmp filedes fd filedes open include cman string noman " - no manual entry available.@n" string pstr "Next entry [n => NO]? " call imsort(table) call imuniq(table) # strip duplicate entry names fd = open(file, READ) if (fd == ERR) call cant(file) fsize(1) = MAX_INTEGER fsize(2) = 0 nentry = 0 s1 = nxtnam(name) s2 = agethd(fd, buf, size, fsize) repeat { if (s1 == EOF | s2 == EOF) break if (any == YES) cmp = 0 else cmp = strcmp(buf, name) if (cmp == -1) { call askip(fd, size, fsize) s2 = agethd(fd, buf, size, fsize) } else if (cmp == 0) { nentry = nentry + 1 if (nentry > 1) { if (gtconf(pstr) == 'n') { s1 = EOF break } } call pruniq(fd, size) s1 = nxtnam(name) s2 = agethd(fd, buf, size, fsize) } else { call putlin(name, ERROUT) call putlin(noman, ERROUT) s1 = nxtnam(name) } } call close(fd) while (s1 != EOF & any == NO) { call putlin(name, ERROUT) call putlin(noman, ERROUT) s1 = nxtnam(name) } return end #-h- dotoc 932 asc 25-mar-82 10:50:14 v1.1 (sw-tools v1.1) subroutine dotoc(suffix, file) character suffix(ARB), file(ARB), buf(MAXLINE) integer nxtcol filedes fd filedes open integer fsize(2), size(2), stat integer agethd character name(MAXLINE) string intstr "Manual entries available in section " fd = open(file, READ) # open the archive help file if (fd == ERR) call cant(file) # problems fsize(1) = MAX_INTEGER # dummy size for file fsize(2) = 0 # ... call putlin(intstr, STDOUT) # header line call putlnl(suffix, STDOUT) #... call putch('@n', STDOUT) # ... call inpack(nxtcol, RIGHT_MARGIN, buf, STDOUT) # initialize packing repeat { stat = agethd(fd, name, size, fsize) # get next header if (stat == ERR) call error("Manual archive in improper format.") if (stat == EOF) break call dopack(name, nxtcol, RIGHT_MARGIN, buf, STDOUT) call askip(fd, size, fsize) # skip over entry } call close(fd) call flpack(nxtcol, RIGHT_MARGIN, buf, STDOUT) return end #-h- gtconf 244 asc 25-mar-82 10:50:15 v1.1 (sw-tools v1.1) character function gtconf(pstr) character pstr(ARB), buf(MAXLINE), c character clower integer junk integer prompt include cpage if (pagefd != ERR) { junk = prompt(pstr, buf, pagefd) c = clower(buf(1)) } else c = 'y' return(c) end #-h- nxtnam 172 asc 25-mar-82 10:50:16 v1.1 (sw-tools v1.1) integer function nxtnam(name) character name(ARB) integer imget include cman if (any == YES) { name(1) = EOS return(OK) } else return(imget(table, name)) end #-h- pruniq 796 asc 25-mar-82 10:50:17 v1.1 (sw-tools v1.1) ## pruniq - locate duplicate lines in archive entry on int subroutine pruniq(int, size) integer agtlin, allblk integer t, size(2), n, blk character buf(MAXLINE) character gtconf include cpage string pstr "More [n => NO]? " if (pagefd == ERR) # no duplicate stripping if not paged { while (agtlin(buf, int, size) != EOF) call putlin(buf, STDOUT) return } n = 0 t = agtlin(buf, int, size) while (t != EOF) { n = n + 1 if (n > pagesz) { if (gtconf(pstr) == 'n') break else n = 0 } call putlin(buf, STDOUT) blk = allblk(buf) t = agtlin(buf, int, size) if (blk == YES) while (t != EOF) if (allblk(buf) == NO) break else t = agtlin(buf, int, size) } while (t != EOF) t = agtlin(buf, int, size) return end %%D 2 #-h- manupd.sh 509 asc 25-mar-82 08:08:59 v1.1 (sw-tools v1.1) %%E 2 %%I 2 #-h- manupd.sh 449 asc 23-apr-82 12:18:35 j (sventek j) %%E 2 # # this script performs an update of the manual system # # usage: manupd section name [name] ... # # where section is one of {1,2,3,4} and name is the name of the # formatted output of the manual entry (eg. sh) # %%D 2 cat ~man/sect$1 >sect$1 %%E 2 %%I 2 cat ~man/s$1 >sect$1 %%E 2 echo Updating local copy of sect$1 ar uv sect$1 $2 $3 $4 $5 $6 $7 $8 $9 echo Creating index$1 locally %%D 2 isam tempdx ar t sect$1 | lam - tempdx | sort >index$1 rm tempdx; echo Now you can move the files sect$1 and index$1 to ~man #-h- manndx.sh 387 asc 25-mar-82 08:08:59 v1.1 (sw-tools v1.1) # # this script generates a new index for a given manual section # # usage: manndx section # # where section is one of {1,2,3,4} # # the file ~man/sect will be indexed, with the index left # in a local file index # isam <~man/sect$1 | find "%#-h-" | ch "%??????????" >tempdx ar t ~man/sect$1 | lam - tempdx | sort >index$1 rm tempdx; echo Now you can move the file index$1 to ~man %%E 2 %%I 2 asam index$1 echo Now copying updated files to ~man cat sect$1 >~man/s$1 cat index$1 >~man/i$1 %%E 2 %%E 1