From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1G5NxE-0001uR-Fq for garchives@archives.gentoo.org; Tue, 25 Jul 2006 14:32:13 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k6PEUYo7021347; Tue, 25 Jul 2006 14:30:34 GMT Received: from desiato.digimed.co.uk (82-69-83-178.dsl.in-addr.zen.co.uk [82.69.83.178]) by robin.gentoo.org (8.13.7/8.13.6) with ESMTP id k6PEQ4gY016651 for ; Tue, 25 Jul 2006 14:26:04 GMT Received: from hactar.digimed.co.uk (hactar.digimed.co.uk [192.168.1.2]) by desiato.digimed.co.uk (Postfix) with ESMTP id CBEC91425D36 for ; Tue, 25 Jul 2006 15:26:02 +0100 (BST) Date: Tue, 25 Jul 2006 15:26:00 +0100 From: Neil Bothwick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] strange [ file Message-ID: <20060725152600.3f30ba10@hactar.digimed.co.uk> In-Reply-To: <1153834916.17716.4.camel@localhost.localdomain> References: <20060725110038.6b2ac3ae@lx-arnau.pic.es> <20060725122653.c8877c2d.hagen_soengen@gmx.de> <20060725132007.2f329c48@hactar.digimed.co.uk> <200607250926.52868.faccenda@gmx.net> <20060725141652.7ea44d99@hactar.digimed.co.uk> <1153834916.17716.4.camel@localhost.localdomain> Organization: Digital Media Production X-Mailer: Sylpheed-Claws 2.4.0-rc4 (GTK+ 2.8.20; x86_64-pc-linux-gnu) X-GPG-Fingerprint: 7260 0F33 97EC 2F1E 7667 FE37 BA6E 1A97 4375 1903 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_HSA5JgMTG6l+A/iboM.3bY0"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Archives-Salt: 457ffea4-49e6-48dc-a18b-7a1a1000d8c9 X-Archives-Hash: b7143588a070b83d86067fe00ad66224 --Sig_HSA5JgMTG6l+A/iboM.3bY0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 25 Jul 2006 15:41:56 +0200, Alan McKinnon wrote: > The answer is simple: Maye, but this isn't it. > 'test' is a bash builtin. When a bash script executes 'test', it is > not /usr/bin/test that runs, but a function internal to bash. test and [ are both Bash builtins, but there are also [ and test commands in /usr/bin. This has nothing to do with the builtins. > /usr/bin/test/ is provided for environments that want to run bash > scripts that use test but bash is not the shell in use. Those scripts can also use /usr/bin/[ > test and [ are not links to each other as they have different syntax > (the closing ]), so they cannot be the same command. If they were > linked, one of them would fail on execution with invalid syntax errors That's wrong, as explained in my previous response that you quoted. A command receives the name it was invoked with as one of its arguments. So it is possible for a command to operate differently according to the name used to run it, such as the gzip/gunzip/zcat example I gave earlier, or the hundreds of commends in netpbm that are mainly symlinks to a few core commands. It's possible to do this with scripts too, I have a number of scripts that act differently according to the name used to run them. --=20 Neil Bothwick Plagarism prohibited. Derive carefully. --Sig_HSA5JgMTG6l+A/iboM.3bY0 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (GNU/Linux) iD8DBQFExin7um4al0N1GQMRAjt6AKDWn57XWASgQKthEEIZcoe4iH9zUACdEdEj aTcptY4mSTmbS83GzpVmx6g= =hB/T -----END PGP SIGNATURE----- --Sig_HSA5JgMTG6l+A/iboM.3bY0-- -- gentoo-user@gentoo.org mailing list