Re: man tool
On Wed, Aug 15, 2001 at 11:22:52AM +0200, Mij wrote:
> I'm thinking to start to develop an easy tool to search through man
> pages. It should find strings and return a list of voices. Any voice is
> the name to request to man ("man voice") to view the page containing
> finded string.
Personally, I think it would be more useful to improve the descriptions
of man pages so that apropos is more likely to work, as full-text search
will more often than not return an unmanageably large number of matches.
> and the method:
> get the paths (easy, with manpath)
> start grep with correct arguments (why implement another, if it's so useful?)
> parsing results
> returning formatted output
I suggest you cache results in a nightly cron job. Grepping through all
the man pages on a moderately-sized system will be too slow for
interactive response. You can probably find documents on information
retrieval on the web that will help you do this properly.
Note, though, that one user's manpath may be different from another's,
and some users may have local trees of man pages, so you might have to
do some on-the-fly caching as well (gee, sounds like mandb ...).
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: