EDIT: This question was closed because (apparently) not a "software" question. Move it to this unix stack-exchange post
man <command> doesn't always point to the "right" (as in "given by which <command>"). Is there a way to make sure (or at least increase the chances that) I get docs that correspond to the command that will actually be executed?
EXAMPLE
With pack (a wads script) I get this:
$ which pack
.../dev/unix_scripts/pack
$ man pack LIBPACK(3)
NAME
libpack - support for connected components
...
Note that here .../dev/unix_scripts/pack doesn't actually have a man page, so I'd like the man to tell me it doesn't find it.
TRIED
If man took full paths to executable, I could do this:
$ which pack | man
This:
$ man 1 pack
No entry for pack in section 1 of the manual
but I'm not sure only looking in section 1 ("Executable programs or shell commands") is too restrictive.