"apropos options" in man -k not working

I thought I could totally replace “apropos” (in my mind :)) and just use “man -k”.

In “man man”, I saw: man -k [apropos options] regexp

Here is the apropos version of a sample search:

apropos -s 1 stat

The man version:

man -k -s 1 stat

The [apropos options], in this case -s 1, was ignored, and all sections searched, not just 1.

Looking around, I have the environment variable, “MAN_POSIXLY_CORRECT”, so I don’t get the prompt when a man name appears more than once (it’s not documented in “man man”). Additional searching and testing didn’t turn anything up.

Is the documentation incorrect? Is my command malformed?

Thank you.

On Tue, 12 Oct 2010 22:06:01 +0000, opensuseforumorg42 wrote:

> apropos -s 1 stat
>
> The man version:
>
> man -k -s 1 stat
>
> The [apropos options], in this case -s 1, was ignored, and all sections
> searched, not just 1.

What if you do:

man -s 1 -k stat

?

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Looks like a bug to me. I’d report it if I were you and let the packagers pass it upstream.

from man man:


man -k printf
Search  the  short  descriptions  and  manual page names for
the keyword printf as regular expression.  Print out any matches.
Equivalent to apropos -r printf.

it says man -k == apropos -r, but not man -k [apropos options] ==
apropos -r [apropos options]

Isn’t that the point of putting [apropos options] in the synopsis? I mean, it says [apropos options], not [only the supported apropos options].

PS: It’s right at the top of the page if you missed it:

man -k [apropos options] regexp …