Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

_man - fast searching for glob patterns



Our system (descendant of Pyramid DC/OSx) has an unusual man system. The man
directory is assumed to have mandb file with format

man_page section path_to_file ...

("normal" man pages are supported as well - with caveat, that if the system
finds mandb man page it never searches for normal one).

Well, it is trivial to look for mandb file ... unfortunately, the number of
manual pages is about 4000 - so, the simple

while read manpage dummy
  if [[ $manpage == $our-search-pattern ]]
   ...
done < $mandb-file

needs a considerable amount of time (10-15 seconds here). Globbing is hard to
use, because path_to_file may be *anything* - so, file names are not always
valid manpage names. And directory structure under man dir may be of any depth
as well - so, recursive globbing is needed and it takes some time as well.

Any idea?

TIA

/andrej



Messages sorted by: Reverse Date, Date, Thread, Author