Subject: Re: /bin/[ ?
To: James K. Lowden <jklowden@schemamania.org>
From: Johan A. van Zanten <johan@ewranglers.com>
List: netbsd-help
Date: 03/13/2002 22:45:35
---In message <20020313224048.0132361f.jklowden@schemamania.org>
>Hi, 
>
>I was looking around /bin to see what's big and small, and came across an odd file called '['.  Would someone kindly tell me why it's there?  
>
>$ uname -a; ls /bin/[; man [
>NetBSD Gateway 1.5.2 NetBSD 1.5.2 (GENERIC) #3: Sat Aug 18 23:37:05 CEST 2001     he@hamster.urc.uninett.no:/usr/src/sys/arch/i386/compile/GENERIC i386
>
>/bin/[
>
>man: no entry for [ in the manual.

 It's synonymous with "test". For example, in the Bourne shell,

if test $a -gt $b
then
  echo "Resistance is useless!"
fi


...is the same as:

if [ $a -gt $b ]
then
  echo "Resistance is useless!"
fi

 Do "man 1 test" to see the man page for it.

 --johan