Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Eric Blake Newsgroups: gnu.bash.bug Subject: Re: Worth mentioning in documentation Date: Mon, 10 Aug 2015 06:55:40 -0600 Organization: Red Hat, Inc. Lines: 59 Approved: bug-bash@gnu.org Message-ID: References: <3156909.AJj7susDjE@debxuan> <2473887.nPWqTkAiyd@debxuan> <20150807122454.GU4309@eeg.ccf.org> <3273328.haPDicsXFC@debxuan> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4q3PRWkXJusAIjqAIID6BuGVHJqol70t5" X-Trace: usenet.stanford.edu 1439211763 7098 208.118.235.17 (10 Aug 2015 13:02:43 GMT) X-Complaints-To: action@cs.stanford.edu Cc: "bug-bash@gnu.org" To: Juanma , Greg Wooledge Envelope-to: bug-bash@gnu.org Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 In-Reply-To: <3273328.haPDicsXFC@debxuan> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11310 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4q3PRWkXJusAIjqAIID6BuGVHJqol70t5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/10/2015 02:18 AM, Juanma wrote: > Here is another point I find confusing: I thought a "shell builtin" did= n't have a separate binary executable file, like 'cd' (which cd =3D> 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=3D705 It is only the special builtins (such as 'exit') where POSIX does not require an exec'able counterpart. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4q3PRWkXJusAIjqAIID6BuGVHJqol70t5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVyJ9SAAoJEKeha0olJ0Nq5ecIAKo1lXQY9nynyr1HAT521DrH ZLMdf0VFEimCPVynHkLSymul8PJwwg8h/lNgkOUbs/eUhYdHIKtxPDy6cyAZ7LI3 197qryi38So+jvC1hb7QNnSJmRipJ2komeJttfPTscWuFhKYj8ab7Zi/SfOA6GLL RCottxarRsz+ejrJojZ2ZFGV4K7Tsc/dq66HGv5f7X9QQmDnNHK91QETZ576OwR5 uM9RKzuvkfzsMZgyYl0idUAJXtneDLCfbiYmMEbhs8Tyfz6OBwuhsslvoWFetFov aXarh+o77HT9Gnns9ncm42Sg4CV5Y6vY/+eL0UbrNJXsfrTbuYJ6iCQVghHckuk= =vw2U -----END PGP SIGNATURE----- --4q3PRWkXJusAIjqAIID6BuGVHJqol70t5--