Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 2017 15:16:47 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Manish Jain <bourne.identity@hotmail.com>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: A request to segregate man pages for shell built-ins
Message-ID:  <20171025151647.b1a1d512.freebsd@edvax.de>
In-Reply-To: <VI1PR02MB1200817E0E2CDD2A2A42E1A5F6440@VI1PR02MB1200.eurprd02.prod.outlook.com>
References:  <VI1PR02MB1200817E0E2CDD2A2A42E1A5F6440@VI1PR02MB1200.eurprd02.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171025151647.b1a1d512.freebsd>