[X-Unix] /bin strange directory ??

Cloyce D. Spradling cloyce+xunix at headgear.org
Mon May 23 20:09:39 PDT 2005


On Mon, May 23, 2005 at 09:03:50PM -0600, Doug McNutt wrote:
: At 20:48 -0500 5/23/05, Cloyce D. Spradling wrote:
: >  if [ "$FOO" = bar ]; then

I forgot to mention that on some shells it _can_ be internal.  In ksh and
zsh, [[ ... ]] is internal.

:  And note that the space after the [ is required. I know of no other
: language that treats spaces that way.

It's not the shell... it's test.  All the shell wants is

if <program>

It's test that wants the space.  I wouldn't expect

  test"$FOO" = bar

to work.  Would you?  The space seems reasonable to me in this context.

: When I have to program in bash I regularly forget the space with disastrous
: consequences. tcsh has it right.

Too bad tcsh couldn't get it right for too much else, programming-wise. :)

--
Cloyce


More information about the X-Unix mailing list