A request to segregate man pages for shell built-ins
Polytropon
freebsd at edvax.de
Wed Oct 25 13:17:05 UTC 2017
On Wed, 25 Oct 2017 02:23:23 +0000, Manish Jain wrote:
> But I run into roughly the same weather with shell built-ins, most of
> which do not have their own man page. 'man set' rather blandly throws up
> the man page for the shell, and it takes an immense effort to glean the
> relevant information.
>
> Is it not possible to create separate man pages for the shell built-ins
> too ? Or at least ensure that invoking the built-in with --help gets the
> necessary information ?
The key problem is that different shells might have a builtin
with the same name, but different syntax or behaviour. That's
why you typically use "man sh" or "man csh" and then search
for the builtin within that man page.
> (Note : some built-ins (e.g. 'test') do have their own man pages)
Well, test is a binary, a separate program, not a builtin. ;-)
% which test
/bin/test
% which [
/bin/[
Of course, [ and test are actually one and the same binary.
Keep in mind some shells also offer a builtin replacement for
an existing binary. A good example is echo where a binary exists,
but the C Shell has its own internal echo, while BASH uses the
binary one:
% which echo
echo: shell built-in command.
$ which echo
/bin/echo
In such a case, what should "man echo" show?
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list