A request to segregate man pages for shell built-ins
freebsd at edvax.de
Wed Oct 25 14:27:27 UTC 2017
On Wed, 25 Oct 2017 10:10:05 -0400, zep wrote:
> On 10/25/2017 09:22 AM, Polytropon wrote:
> > On Wed, 25 Oct 2017 08:03:03 +0000, Manish Jain wrote:
> >> On 10/25/17 13:23, Erwan DAVID wrote:
> >>> That would mean doing a new section per shell eg (1bash) (1csh) (1zsh)
> >>> each shell has its own builtins, Hicham can differ (compare set in bash
> >>> and csh )
> >> Perhaps a new, unique section of man pages (something like section 99)
> >> implemented for sh only and which can be called by any shell with the
> >> same syntax : 'man 99 set'
> > Or like pkg's "sub-manpages", with a hyphen:
> > % man echo-csh
> > compared to
> > % man test-bash
> > And for "identical implementations", compound manuals just as if
> > you'd use "man 3 malloc" or "man 3 calloc" to take you to the same
> > manual page.
> you could also build a 'smarter' man in such a case - e.g. as a shell
> script wrapper kinda thing, it could do a which first, find out if the
> shell you're currently running it from has a builtin, if there's a
> binary, then chose the right one for how it's called and possibly
> include a caveat about other versions.
This is possible, but there is the following obstacle:
A shell can invoke an external command or a builtin depending
on execution context, i. e., if the shell is currently processing
a shell script, the builtin will be used, but if it runs an
interactive session, the external command will be called.
I cannot remember what shell it was, but I encountered this
strange behaviour once, many years ago: Something that worked
at the command line didn't work the same way when used inside
a shell script, even though the text was used 1:1. It was on
some expensive UNIX nobody remembers anymore... ;-)
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions