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 ) 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 ; Thu, 13 Oct 2011 13:59:22 +0000 (UTC) Received: by bkbzt12 with SMTP id zt12so1839633bkb.40 for ; 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: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail 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> <20111012184927.44ed070b@toxic.dbnet> <20111013155058.52e870c3@rohan.example.com> Date: Thu, 13 Oct 2011 09:59:21 -0400 Message-ID: Subject: Re: [gentoo-user] "/usr/bin/[" and coreutils From: Michael Mol 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 wr= ote: > On Thu, 13 Oct 2011 15:38:08 +0200 > Jes=C3=BAs J. Guerrero Botella 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