Working with man pages and appropos

I have installed Haiku as a virtualbox virtual machine on my
Debian-based Linux system.
Installed from haiku-r1beta6-x86_64-anyboot.iso

It is one of many VMs that I have: Windows 10 with CYGWIN, Windows 11
with CYGWIN, FreeBSD, Solaris, and Macos.

I have an Apache web server on my Linux system. I have written a
cgi-bin script that accesses the hosted virtual machines using
ssh/sshpass to retrieve and present the virtual machine’s available
online man pages.

I see that Haiku has these online man pages. So I would like to add
Haiku to the set of systems that I can support in accessing them.

As a part of the man page presentaion is initally presenting a list of
the available pages, For this I use the hosted system’s appropos (or
equivalent) command. This is also used in performing searches.

My problem with Haiku while there is a appropos command all it
presents is ‘command not found’. Looking into things further there is
reference to the makewhatis command. But running this command does
nothing. And the appropos command still returns nothing.

So my question/problem is how can I on Haiku get the appropos commnd
to run and present man page information?

1 Like

If man is part of the base system, certainly apropos should be as well.

Me also tried it.
I assume at ports such data that includes the man pages, mostly not delivered with the ported software - so no pages on the Haiku system to show.
Command like man and apropos just sits there as items of basic GNU programs, possibly parts of a GNU tool package or built-in command of the Bourne shell, but nothing else.

you may check

pkgman search cmd:man
pkgman search cmd:apropos

From which package they come from ..

+++

Well I searched the net, and asked

a ) ‘is man command a shell built-in ?’

I got it’s external, standalone binary program - it is pager for manuals of UNIX/Linux systems (that’s part I was surely know - now I was confirmed as external one)

“The easiest way to determine whether a command is built-in or external is by running the type command.”

a ) ‘is apropos command a shell built-in ?’

I got it’s also an external, standalone binary program

So, it worth to find the package with the above lines I wrote ..
We may try to search a Haiku package with manpages in the package names -
if there’s no shuch ones, then you won’t get manuals with Haiku in terminal, but with lynx browser, to search these command online to find online version of manual pages of Linux man pages :smiley:

:cowboy_hat_face:

We don’t really use the man system outselves at all.
man itself is part of posix, but apropos is not.

Where did you get this info from? If you say “the internet” you should atleast include a source, because copying those AI overviews here is not allowed. Also note that “command -v” is the correct way to figure out where a command sits, in posix. type is not part of posix.

It’s in mandoc:

Doesn’t seem to function though?

~> apropos -v
apropos: invalid option -- 'v'
usage: apropos [-afk] [-C file] [-M path] [-m path] [-O outkey] [-S arch]
               [-s section] expression ...
~> apropos aclocal
apropos: nothing appropriate
~> man aclocal (working)
~> apropos -C /system/documentation/man/man1/aclocal.1
usage: apropos [-afk] [-C file] [-M path] [-m path] [-O outkey] [-S arch]
               [-s section] expression ...

1 Like

I didn’t mean it should be there because POSIX; I guess it’s just one of those things I got used to being everywhere.

Ok, it is not Posix,

But can it be supported? Which means I guess the other parts (the whatis DB and all) as well.

probably, yeah. But seeing as we don’t ship our documentation in a man compatible format it would likely not fix your initial problem

No I don’t need/want all documentation. Just the man pages. I have over 40 years of programming. Maybe could work on this. How do I get the source? I see that things are compiled with gcc. Well I guess I need to read the docs on developer contributions. And, my primary editor is Emacs. Any thoughts or plans of having that on Haiku?

1 Like

OK. I have done git clone https://review.haiku-os.org/haiku and resulting tree does not show man or apropos. Am I missing something?

The command(s) are not in Haikus source tree, if you want to figure out why they work or do not work you will have to work on haikuports instead. Both commands seem to be in the mandoc package. You can check this with pkgman, for example
“pkgman search cmd:apropos” or “pkgman search cmd:man”

> ~> pkgman search cmd:man
Status  Name      Description

    manaplus  A free opensource 2D MMORPG client                      

S       mandoc    A suite of tools compiling mdoc from the OpenBSD project
netpbm    Toolkit for manipulation of graphic images
s       nss       Mozilla’s library that implements PKI support

~> pkgman search cmd:apropos
Status  Name    Description

S       mandoc  A suite of tools compiling mdoc from the OpenBSD project

You can get the recipe from haikuports GitHub - haikuports/haikuports: Software ports for the Haiku operating system. · GitHub

Emacs is also already available, you can install it with “pkgman install app:emacs”

1 Like