[X-Unix] /bin strange directory ??

Doug McNutt douglist at macnauchtan.com
Mon May 23 20:03:50 PDT 2005


At 20:48 -0500 5/23/05, Cloyce D. Spradling wrote:
>  if [ "$FOO" = bar ]; then
>
>you probably thought that it was all internal.  Not so!  The above is
>equivalent to
>
>  if test "$FOO" = bar; then
>
>That link to '[' is an important part of the above recipe.  All the shell
>does is ignore the ']'. :)

 And note that the space after the [ is required. I know of no other language that treats spaces that way. When I have to program in bash I regularly forget the space with disastrous consequences. tcsh has it right.

-- 

--> From the U S of A, the only socialist country that refuses to admit it. <--


More information about the X-Unix mailing list