A patch to man to handle "man.1"...

Chuck Swiger cswiger at mac.com
Sat Jul 19 16:48:39 PDT 2003


Ruslan Ermilov wrote:
> On Sat, Jul 19, 2003 at 06:34:50PM -0400, Chuck Swiger wrote:
>>I've always thought that specifying sections via "man -s 1 man" or "man 1 
>>man" was ugly, and didn't work very well with filename completion.  Diff 
>>relative to /usr/src/gnu/usr.bin/man to also handle the syntax of "man 
>>man.1":
>
> That would break man(1); currently, the "man ld-elf.so.1" displays
> the manpage, and your patch precludes the use of ".[0-9]" in the
> tails of manpage names.

Thanks for this example.  However, if you try the patch, you'll discover that 
this case also works properly:

106-sec# man -d ld-elf.so.1

using less as pager

using i386 architecture
found mandatory man directory /usr/share/man
found mandatory man directory /usr/share/perl/man
found mandatory man directory /usr/share/openssl/man
found optional man directory /usr/local/lib/perl5/5.8.0/man
found optional man directory /usr/local/lib/perl5/5.8.0/man
found optional man directory /usr/local/lib/perl5/5.00503/man
found manpath map /bin --> /usr/share/man
found manpath map /usr/bin --> /usr/share/man
found manpath map /usr/local/bin --> /usr/local/man
found manpath map /usr/X11R6/bin --> /usr/X11R6/man

search path for pages determined by manpath is
/usr/local/man:/usr/share/man:/usr/man

adding /usr/local/man to manpathlist
adding /usr/share/man to manpathlist
adding /usr/man to manpathlist

section (via suffix): 1

searching in /usr/local/man
trying section 1 with globbing
globbing /usr/local/man/man1/ld-elf.so.1*
globbing /usr/local/man/man1/ld-elf.so.0*
globbing /usr/local/man/cat1/ld-elf.so.1*
globbing /usr/local/man/cat1/ld-elf.so.0*

searching in /usr/share/man
trying section 1 with globbing
globbing /usr/share/man/man1/ld-elf.so.1*
to_name in convert_name () is: /usr/share/man/cat1/ld-elf.so.1.1.gz
will try to write /usr/share/man/cat1/ld-elf.so.1.1.gz if needed
status from is_newer() = 0

trying command: /usr/bin/zcat /usr/share/man/cat1/ld-elf.so.1.1.gz | less

	--

It works as does "man 1 ld-elf.so.1" and even "man 1 ld-elf.so"...

-- 
-Chuck




More information about the freebsd-stable mailing list