On Oct 17, 2024, at 1:08 PM, Greg A. Woods <woods(a)robohack.ca> wrote:
I was taught, right
from the beginning, to use the permuted index to find things, which is
essentially what BSD apropos(1) does.
Unfortunately things are a bit more complicated now!
On freebsd:
$ apropos ls | wc
1761 11158 121413
$ apropos ls | tail -1
refchan.tcl86, refchan(n) - command handler API of reflected channels
Looks like it is matching "ls" in "channels". May be it should match
full words? You can get this effect today with a bit more work:
$ apropos '\<ls\>' | wc
9 187 1260
But who'd remember to do that?
And man pages themselves need some work:
$ apropos tcl_fsdata
Tcl_AllocStatBuf.tcl86, Tcl_FSAccess.tcl86, Tcl_FSChdir.tcl86,
Tcl_FSConvertToPathType.tcl86, Tcl_FSCopyDirectory.tcl86, Tcl_FSCopyFile.tcl86,
Tcl_FSCreateDirectory.tcl86, Tcl_FSData.tcl86, Tcl_FSDeleteFile.tcl86,
Tcl_FSEqualPaths.tcl86, Tcl_FSEvalFile.tcl86, Tcl_FSEvalFileEx.tcl86,
Tcl_FSFileAttrsGet.tcl86, Tcl_FSFileAttrsSet.tcl86, Tcl_FSFileAttrStrings.tcl86,
Tcl_FSFileSystemInfo.tcl86, Tcl_FSGetCwd.tcl86, Tcl_FSGetFileSystemForPath.tcl86,
Tcl_FSGetInternalRep.tcl86, Tcl_FSGetNativePath.tcl86, Tcl_FSGetNormalizedPath.tcl86,
Tcl_FSGetPathType.tcl86, Tcl_FSGetTranslatedPath.tcl86,
Tcl_FSGetTranslatedStringPath.tcl86, Tcl_FSJoinPath.tcl86, Tcl_FSJoinToPath.tcl86,
Tcl_FSLink.tcl86, Tcl_FSListVolumes.tcl86, Tcl_FSLoadFile.tcl86, Tcl_FSLstat.tcl86,
Tcl_FSMatchInDirectory.tcl86, Tcl_FSMountsChanged.tcl86, Tcl_FSNewNativePath.tcl86,
Tcl_FSOpenFileChannel.tcl86, Tcl_FSPathSeparator.tcl86, Tcl_FSRegister.tcl86,
Tcl_FSRemoveDirectory.tcl86, Tcl_FSRenameFile.tcl86, Tcl_FSSplitPath.tcl86,
Tcl_FSStat.tcl86, Tcl_FSUnloadFile.tcl86, Tcl_FSUnregister.tcl86, Tcl_FSUtime.tcl86,
Tcl_GetAccessTimeFromStat.tcl86, Tcl_GetBlocksFromStat.tcl86,
Tcl_GetBlockSizeFromStat.tcl86, Tcl_GetChangeTimeFromStat.tcl86,
Tcl_GetDeviceTypeFromStat.tcl86, Tcl_GetFSDeviceFromStat.tcl86,
Tcl_GetFSInodeFromStat.tcl86, Tcl_GetGroupIdFromStat.tcl86,
Tcl_GetLinkCountFromStat.tcl86, Tcl_GetModeFromStat.tcl86,
Tcl_GetModificationTimeFromStat.tcl86, Tcl_GetSizeFromStat.tcl86,
Tcl_GetUserIdFromStat.tcl86, Tcl_FSRegister, Tcl_AllocStatBuf, Tcl_FSAccess, Tcl_FSChdir,
Tcl_FSConvertToPathType, Tcl_FSCopyDirectory, Tcl_FSCopyFile, Tcl_FSCreateDirectory,
Tcl_FSData, Tcl_FSDeleteFile, Tcl_FSEqualPaths, Tcl_FSEvalFile, Tcl_FSEvalFileEx,
Tcl_FSFileAttrsGet, Tcl_FSFileAttrsSet, Tcl_FSFileAttrStrings, Tcl_FSFileSystemInfo,
Tcl_FSGetCwd, Tcl_FSGetFileSystemForPath, Tcl_FSGetInternalRep, Tcl_FSGetNativePath,
Tcl_FSGetNormalizedPath, Tcl_FSGetPathType, Tcl_FSGetTranslatedPath,
Tcl_FSGetTranslatedStringPath, Tcl_FSJoinPath, Tcl_FSJoinToPath, Tcl_FSLink,
Tcl_FSListVolumes, Tcl_FSLoadFile, Tcl_FSLstat, Tcl_FSMatchInDirectory,
Tcl_FSMountsChanged, Tcl_FSNewNativePath, Tcl_FSOpenFileChannel, Tcl_FSPathSeparator,
Tcl_FSRemoveDirectory, Tcl_FSRenameFile, Tcl_FSSplitPath, Tcl_FSStat, Tcl_FSUnloadFile,
Tcl_FSUnregister, Tcl_FSUtime, Tcl_GetAccessTimeFromStat, Tcl_GetBlocksFromStat,
Tcl_GetBlockSizeFromStat, Tcl_GetChangeTimeFromStat, Tcl_GetDeviceTypeFromStat,
Tcl_GetFSDeviceFromStat, Tcl_GetFSInodeFromStat, Tcl_GetGroupIdFromStat,
Tcl_GetLinkCountFromStat, Tcl_GetModeFromStat, Tcl_GetModificationTimeFromStat,
Tcl_GetSizeFromStat, Tcl_GetUserIdFromStat(3) - procedures to interact with any
filesystem
$ apropos tcl_fsdata|wc
1 119 2679
One very long line!
Seems word search on unix for such things needs to be beefed up....