Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11310 > unrolled thread

Re: Worth mentioning in documentation

Started byEric Blake <eblake@redhat.com>
First post2015-08-10 06:55 -0600
Last post2015-08-10 06:55 -0600
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Worth mentioning in documentation Eric Blake <eblake@redhat.com> - 2015-08-10 06:55 -0600

#11310 — Re: Worth mentioning in documentation

FromEric Blake <eblake@redhat.com>
Date2015-08-10 06:55 -0600
SubjectRe: Worth mentioning in documentation
Message-ID<mailman.8069.1439211762.904.bug-bash@gnu.org>

[Multipart message — attachments visible in raw view] — view raw

On 08/10/2015 02:18 AM, Juanma wrote:

> Here is another point I find confusing: I thought a "shell builtin" didn't have a separate binary executable file, like 'cd' (which cd => fail),

Actually, POSIX requires that there be a separate 'cd' binary, although
it does not have to behave the same as the shell builtin.  (About all an
exec'able cd can do is tell you by exit status whether the builtin cd
would succeed or fail; or be used for its CDPATH side-effect of printing
a directory name).

GNU/Linux systems tend to ignore the POSIX requirement of exec'able
counterparts, although here is how Solaris effectively does it:

$ cat /bin/cd
#!/bin/sh
exec $(basename $0) "$@"
$

and hard-linking that 2-liner to all of the shell builtins where POSIX
requires to have a non-builtin counterpart.

See also http://austingroupbugs.net/view.php?id=705

It is only the special builtins (such as 'exit') where POSIX does not
require an exec'able counterpart.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web