Am Tue, 11 Oct 2011 22:42:00 -0700
schrieb Canek Peláez Valdés <can...@gmail.com>:

> On Tue, Oct 11, 2011 at 10:35 PM, William Kenworthy
> <bi...@iinet.net.au> wrote:
> > I have been checking my system for some deep seated problems and in
> > the process, ran across the fact that "equery files
> > sys-apps/coreutils-8.7" shows a file included called "/usr/bin/[" -
> > thats right, left square bracket!
> >
> > Is that a bug or if real, what would you use it for?  It doesnt
> > seem to be on the file system ...
> >
> > moriah ~ # /usr/bin/[
> > /usr/bin/[: missing `]'
> > moriah ~ #
> >
> > doesnt show much!
> 
> Relax. It's an alias for "test"

technically it's not an alias, but different binaries

% ls -l /usr/bin/\[
-rwxr-xr-x 1 root root 35096 Jan 20  2011 /usr/bin/[
% ls -l /usr/bin/test
-rwxr-xr-x 1 root root 31000 Jan 20  2011 /usr/bin/test

built from the same source file coreutils/src/test.c with a 
#define LBRACKET
that mainly changes the behavior of the argument parser in case it is
built as [.


>, so instead of using
> 
> if test blah; then
> ...
> fi
> 
> in bash, you can use
> 
> if [ blah ]; then
> ...
> fi
> 
> Just do /usr/bin/[ --help to get an idea. It has been there since I
> started using Linux, if I remember correctly, many years ago.
> 
> Regards.

Reply via email to