From owner-freebsd-questions Mon Jun 21 4:40:34 1999 Delivered-To: freebsd-questions@freebsd.org Received: from wfdutil3gw.ml.com (wfdutil3f01.ml.com [206.3.74.33]) by hub.freebsd.org (Postfix) with ESMTP id D019214C8C for ; Mon, 21 Jun 1999 04:40:29 -0700 (PDT) (envelope-from mwang@tech.cicg.ml.com) Received: from ewfdav02.ml.com ([199.201.57.18]) by wfdutil3gw.ml.com (8.9.3/8.9.3/MLgwo-4.03) with SMTP id HAA18901 for ; Mon, 21 Jun 1999 07:40:28 -0400 (EDT) Received: from 172.23.142.207 by ewfdav02.ml.com (InterScan E-Mail VirusWall NT); Mon, 21 Jun 1999 07:40:22 -0400 (Eastern Daylight Time) Received: by cicgload-fs1-p.tech.cicg.ml.com (8.8.8+Sun/ML55SMX-1.02) id HAA05809; Mon, 21 Jun 1999 07:40:27 -0400 (EDT) Date: Mon, 21 Jun 1999 07:40:27 -0400 (EDT) From: mwang@tech.cicg.ml.com (Michael Wang) Message-Id: <199906211140.HAA05809@cicgload-fs1-p.tech.cicg.ml.com> To: freebsd-questions@FreeBSD.ORG Subject: RE: what is the command named "[" in /bin directory? Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Thank you very much for the quick response. Solaris [System V] > > treats test, cd, alias, bg, ..., 17 such "command" as ksh built in. > > See > > below. It is interesting to see that BSD treats "[" as a real command. > > > > > > Thanks again. > [ML] They are built in in pdksh, bash, tcsh, etc as well. > > They are not built in in /bin/sh. Not even in Solaris. And > /bin/sh is the standard scripting shell. However, the /bin/sh may be > internally interpreting [ as a call to test (which the FreeBSD /bin/sh > apparently does not do, hence /bin/[). How did you conclude that they are not built in in /bin/sh in Solaris? My conclusion is test and "[" are /bin/sh built-ins. test is a built-in per shell_builtins man page, and [ ... ] is the same as test. There is no "[" command in Solaris. The following is a list of shell_builtins from man page in Solaris: command built into alias csh, ksh bg csh, ksh, sh break csh, ksh, sh case csh, ksh, sh cd csh, ksh, sh chdir csh, sh continue csh, ksh, sh dirs csh echo csh, ksh, sh eval csh, ksh, sh exec csh, ksh, sh exit csh, ksh, sh export ksh, sh fc ksh fg csh, ksh, sh for ksh, sh foreach csh function ksh getopts ksh, sh glob csh goto csh hash ksh, sh hashstat csh history csh if csh, ksh, sh jobs csh, ksh, sh kill csh, ksh, sh let ksh limit csh login csh, ksh, sh logout csh, ksh, sh nice csh newgrp ksh, sh notify csh onintr csh popd csh print ksh pushd csh pwd ksh, sh read ksh, sh SunOS 5.7 Last change: 1 Feb 1995 1 User Commands shell_builtins(1) readonly ksh, sh rehash csh repeat csh return ksh, sh select ksh set csh, ksh, sh setenv csh shift csh, ksh, sh source csh stop csh, ksh, sh suspend | csh, ksh, sh switch | csh test | ksh, sh time | csh times | ksh, sh trap | ksh, sh type | ksh, sh typeset | ksh ulimit | ksh, sh umask | csh, ksh, sh unalias | csh, ksh unhash | csh unlimit | csh unset | csh, ksh, sh unsetenv | csh until | ksh, sh wait | csh, ksh, sh whence | ksh while | sh, ksh, sh To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message