> 
> > Whether actually defined in shell or not, I can at least think of
> > semantics for expressions like
> >   [ hello ]   or  [ $hello ]   or  [ -n hello ]   or  [ -n $hello ]   or
> >   [ "foo bar" ]   or  [ -n "foo bar" ]
> > but I have problems with the semantics of the OP's contruct
> >   [ -n foo bar ]
> > and what it should mean.
> > 
> > 
> 
> I don't know what the semnatic of [ $hello ] and [ -n $hello ].

As said, I can *think* of semantics like in C/C++;
if (var)  being equivalent to  if (iszero(var))  or equivalent to
if(var==0)  or  if (isempty(var))  or  if(var=="")

> 
> 
> If
>       hello='foo bar'
> then
>        [ -n $hello ]
> and
>       [ -n foo bar ]
> are the same so how can you understand one and not the other?

I was sloppy. Please take the variables in my examples as being all quoted

[ -n "$hello" ]

so that you have one argument or an option and one argument there.

> 
> 
> David Korn
> [email protected]
                                          
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to