Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jun 1999 10:53:37 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Michael Wang <mwang@tech.cicg.ml.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: what is the command named "[" in /bin directory?
Message-ID:  <19990621105336.B6820@freebie.lemis.com>
In-Reply-To: <199906210117.VAA04758@cicgload-fs1-p.tech.cicg.ml.com>; from Michael Wang on Sun, Jun 20, 1999 at 09:17:50PM -0400
References:  <199906210117.VAA04758@cicgload-fs1-p.tech.cicg.ml.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, 20 June 1999 at 21:17:50 -0400, Michael Wang wrote:
> Dear FreeBSDers:
>
> What is the command named "[" in /bin as shown below?

It's a synonym for 'test':

  $ls -li /bin/[ /bin/test
  1435 -r-xr-xr-x  2 root  wheel  48732 Jun 18 11:29 /bin/[
  1435 -r-xr-xr-x  2 root  wheel  48732 Jun 18 11:29 /bin/test

It's used for things like:

  if [ -f /unix ]; then
    echo "System V";
  elif [ -f /kernel ]; then
    echo BSD;
  fi

Greg
--
When replying to this message, please copy the original recipients.
For more information, see http://www.lemis.com/questions.html
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990621105336.B6820>