From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-129710-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RELsC-00059O-JP
	for garchives@archives.gentoo.org; Thu, 13 Oct 2011 14:03:00 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id D8FAA21C10C;
	Thu, 13 Oct 2011 14:02:26 +0000 (UTC)
Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53])
	by pigeon.gentoo.org (Postfix) with ESMTP id C749121C04E
	for <gentoo-user@lists.gentoo.org>; Thu, 13 Oct 2011 13:59:22 +0000 (UTC)
Received: by bkbzt12 with SMTP id zt12so1839633bkb.40
        for <gentoo-user@lists.gentoo.org>; Thu, 13 Oct 2011 06:59:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding;
        bh=QbBdrwtBO0nkhBU9R9V3OP+/loV5KjG0czF7wDNtiX4=;
        b=IHTKOTJxQqpkt45HmUHM5mTyR/jvPSClNNw949myWyNf+n97SesBlltu+lw1LMdm0H
         QuFrA/UMDOpShNmFHFS+LBG3X6MoPMe/pT8mvXA0Jj8ahJBZc6NbVFhwVCGeTQm5GmEe
         OWI987MI4hZnDaywA2BQHIa2E8wy1+JJM+0zw=
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.204.130.155 with SMTP id t27mr2828405bks.49.1318514361884;
 Thu, 13 Oct 2011 06:59:21 -0700 (PDT)
Received: by 10.204.177.199 with HTTP; Thu, 13 Oct 2011 06:59:21 -0700 (PDT)
In-Reply-To: <20111013155058.52e870c3@rohan.example.com>
References: <1318397707.15637.3.camel@moriah>
	<CADPrc804j2auq1CvD9HbnEErCby6+3_2huaP015nA_aWs87mvQ@mail.gmail.com>
	<20111012184927.44ed070b@toxic.dbnet>
	<CAMix8LENwgyh8RE0k73q0CqtggECWO6073Ge_fHQ_o4DEjR6uA@mail.gmail.com>
	<20111013155058.52e870c3@rohan.example.com>
Date: Thu, 13 Oct 2011 09:59:21 -0400
Message-ID: <CA+czFiABDc6yh6=LBRn3n23b8VWBLDjTSfubX_a6=r1Nksku3A@mail.gmail.com>
Subject: Re: [gentoo-user] "/usr/bin/[" and coreutils
From: Michael Mol <mikemol@gmail.com>
To: gentoo-user@lists.gentoo.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: df41db4ad537480f4987c9ad673d0217

On Thu, Oct 13, 2011 at 9:50 AM, Alan McKinnon <alan.mckinnon@gmail.com> wr=
ote:
> On Thu, 13 Oct 2011 15:38:08 +0200
> Jes=C3=BAs J. Guerrero Botella <jesus.guerrero.botella@gmail.com> wrote:
>
>> Yes, it's a different binary, and it's perfectly usual to find it in a
>> Linux system.
>>
>> But note that, at least in bash, you rarely will be using /usr/bin/[
>> unless you reference it using the full path (either in a relative or
>> absolute way). This is because bash has a builtin that takes over that
>> binary file. You can check that (or any other command) by using the
>> "type" instruction (again, this is for bash).
>>
>> # LC_ALL=3DC type [
>> [ is a shell builtin
>>
>> The same goes for 'test'.
>>
>> Those binaries are probably there just in case that some init or
>> system script written for a standard bourne shell (like the busybox
>> one) needs it. But don't take my word for it. I am not sure right now.
>
> You might not be sure, but that doesn't stop you still being correct :-)
>
> The binaries are usually POSIX-compliant, whereas the builtins may
> include extra bashisms (which tend to break apps expecting just
> the basic POSIX behaviour)

I haven't encountered POSIX-dependent apps breaking on bash, but I
have encountered the reverse. My most annoying experience was when I
tried building cinelerra on Debian a few years back. Cinelerra's
script started with #!/bin/sh, but depended on bashisms--and I was
running dash.

--=20
:wq