![]() |
grepping all manfiles
From man(1):
Quote:
I'll write a script if I have to, but I'd like to avoid it so I can do it on whatever box I'm faced with. My linux/bash skillz are getting better all the time, but they aren't yet good enough to figure this one out. |
The manual comes with two commands for identifying pages which contain keywords:
Code:
man -k searchterm |
No, I know about apropos, but far too often it returns "nothing appropriate". I like my regular expressions.
|
Well, I worked on it a bit more. Here's the best I've come up with so far:
Code:
$ find `man -w | tr : ' '` -name '*' | xargs zgrep [ GREP_OPTIONS ] [ -e ] PATTERN |
Quote:
Code:
apropos -r some_reCode:
apropos -w 'some_wilcard*'
|
hmm...my apropos has no options...Probably because it dates back from 1991. Well that's interesting.
I only know a little about the manpage markup. I suppose I can send it to man2html and then parse past the tags pretty easily... |
You could use nroff -man to process them too. Thing is, parsing thousands of man pages will take quite some time. You'll probably want to build an index and search that with your tool. If you do that, you'll need some sort of index update job. This is a similar approach to updatedb/locate.
|
aha yes. This helps. I haven't used groff/nroff much yet.
|
If your system uses catman, you'll have pre-processed versions of some files, which could save you quite a bit of time.
|
| All times are GMT -5. The time now is 07:51 AM. |