Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] "/usr/bin/[" and coreutils
Date: Wed, 12 Oct 2011 05:43:40
Message-Id: CADPrc804j2auq1CvD9HbnEErCby6+3_2huaP015nA_aWs87mvQ@mail.gmail.com
In Reply to: [gentoo-user] "/usr/bin/[" and coreutils by William Kenworthy
1 On Tue, Oct 11, 2011 at 10:35 PM, William Kenworthy <billk@×××××××××.au> wrote:
2 > I have been checking my system for some deep seated problems and in the
3 > process, ran across the fact that "equery files sys-apps/coreutils-8.7"
4 > shows a file included called "/usr/bin/[" - thats right, left square
5 > bracket!
6 >
7 > Is that a bug or if real, what would you use it for?  It doesnt seem to
8 > be on the file system ...
9 >
10 > moriah ~ # /usr/bin/[
11 > /usr/bin/[: missing `]'
12 > moriah ~ #
13 >
14 > doesnt show much!
15
16 Relax. It's an alias for "test", so instead of using
17
18 if test blah; then
19 ...
20 fi
21
22 in bash, you can use
23
24 if [ blah ]; then
25 ...
26 fi
27
28 Just do /usr/bin/[ --help to get an idea. It has been there since I
29 started using Linux, if I remember correctly, many years ago.
30
31 Regards.
32 --
33 Canek Peláez Valdés
34 Posgrado en Ciencia e Ingeniería de la Computación
35 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] "/usr/bin/[" and coreutils Jonas de Buhr <jonas.de.buhr@×××.net>