On Sun, Nov 20, 2022 at 08:45:01PM +0000, Jason McIntyre wrote:
> On Sun, Nov 20, 2022 at 08:09:13PM +0100, Tomasz Rola wrote:
[...]
> > I am writing this from ParrotOS (Debian derivative) and since I am
> > avid user of bash, I can do "man bash-builtins" and it prints me a
> > very nice looking summary. Bash package version is 5.1-2+deb11u1,
> > which probably means 5.1 with some Debian-specific addons.
> > 
> 
> the thing is, you have to be aware of a builtins page in order to know
> to type "man builtins" (or whatever). you would need to know that a
> command is a builtin. but if you know it's a builtin, then you can just
> type "man ksh" and get the documentation.

Sure. As a matter of fact, I was for years grumbling about how long
bash manpage is and how long it takes to locate relevant info. Today I
have learned to look for "builtin(|s)" with apropos and here it is.

I have dug a bit deeper and  "zcat /usr/share/man/man7/bash-builtins.7.gz"
shows me that it is just a *roff hack to display subsection of bash
manpage. Worth remembering.

> we could add all these commands to ksh's NAME, but that would look awful.

I guess it would not be very hard to just add few more *roff hacks
similar to one above. Or maybe a command (shell script) to retrieve
relevant subsection from manpage and print just this one. And maybe
also list names of subsections available on the page. It seems that
'^[A-Z]( |[A-Z])+$' is the name regexp... So...

$  man bash | grep -iE '^[A-Z]( |[A-Z])+$'
NAME
SYNOPSIS
COPYRIGHT
DESCRIPTION
...
SHELL BUILTIN COMMANDS
... and so on.

-- 
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.      **
** As the answer, master did "rm -rif" on the programmer's home    **
** directory. And then the C programmer became enlightened...      **
**                                                                 **
** Tomasz Rola          mailto:tomasz_r...@bigfoot.com             **

Reply via email to