Operating System - HP-UX
1753559 Members
5777 Online
108796 Solutions
New Discussion юеВ

Re: Posix 'whatis' equivalent

 
Jayson Hurd_2
Advisor

Posix 'whatis' equivalent

Is there a command in the Posix shell equivalent to 'whatis' in BASH? Is there a way to search commands like using 'man -k searchword' in BASH? I'm using HP-UX 11i with the POSIX shell.
Most things worth having don't come easily.
4 REPLIES 4
Jerome Baron
Respected Contributor

Re: Posix 'whatis' equivalent

Hi,

You can use man -k, but before you should run /etc/catman with the -w option.

Regatds,
Jerome
Massimo Bianchi
Honored Contributor

Re: Posix 'whatis' equivalent

Hi,
in posix shell whatis is the "man -k keyword".

You should first build the man db, using the command

catman -m &


and wait about 20 minutes :)

Massimo

twang
Honored Contributor

Re: Posix 'whatis' equivalent

Run catman that creates the file /usr/share/lib/whatis which allows you to do keyword searches of all man pages:
# catman -m
Bill Hassell
Honored Contributor

Re: Posix 'whatis' equivalent

man -k will perform a simple string search through the man page 1-liners, but the database (the /usr/share/lib/whatis database) must be built (and maintained). The most common man pages are the 1,1m,2,3,4,5 sections of the Unix 'bricks' so you can use catman to create the current 1-liners databse with:

catman -w 11m2345

You can also populate the cat* directories with pre-formatted man pages (takes a lot longer):

catman -w -z 11m2345

And then for maintenance (a cron job is good for this), use the -m option from now on to find newer man pages (changed or added):

catman -m 11m2345


Bill Hassell, sysadmin