[X-Unix] /bin strange directory ??

Alexandre Gauthier supernaut at underwares.org
Mon May 23 20:22:18 PDT 2005


Doug McNutt wrote:

>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.
>
>  
>
For random informative bits, [ is a shell builtin on bash. At least on
my Linux workstation, my iBook is too far away for me to check, and i'm
lazy.

supernaut at ewigkeit bin $ type [
[ is a shell builtin
supernaut at ewigkeit bin $

-- 
Alexandre Gauthier
supernaut at underwares.org

underwares.org
Obscure IT knowledge Open Database

The human brain operates at only 10% of its capacity. The rest is overhead for
the operating system. 



More information about the X-Unix mailing list