[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Worth mentioning in documentation
From: |
Eric Blake |
Subject: |
Re: Worth mentioning in documentation |
Date: |
Mon, 10 Aug 2015 06:55:40 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
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
signature.asc
Description: OpenPGP digital signature
- Worth mentioning in documentation, Juanma, 2015/08/06
- Re: Worth mentioning in documentation, Greg Wooledge, 2015/08/06
- Message not available
- Re: Worth mentioning in documentation, Greg Wooledge, 2015/08/07
- Re: Worth mentioning in documentation, Eduardo A . Bustamante López, 2015/08/07
- Re: Worth mentioning in documentation, Juanma, 2015/08/10
- Re: Worth mentioning in documentation, Greg Wooledge, 2015/08/10
- Re: Worth mentioning in documentation, Bob Proulx, 2015/08/10
- Re: Worth mentioning in documentation, Juanma, 2015/08/11
- Re: Worth mentioning in documentation,
Eric Blake <=