> From: [email protected]
> Date: Fri, 1 Jun 2012 22:12:04 +0800
> Subject: Re: [ast-users] [ksh93] How to understand `[ -n hello world ]'?
> To: [email protected]
> 
> On Fri, Jun 1, 2012 at 9:13 PM, Glenn Fowler <[email protected]> wrote:
> >
> > try this for a hint:
> >
> >        [ hello ] && echo yes
> 
> I know what this means. I've been using bash for years and I know
> what's the difference between [ ] and [[ ]].
> 
> I just cannot understand how to interpret [ -n foo bar ] in ksh.

What is your expectation here, if you write such an expression;
what (operational) semantics do you expect?

> ksh
> is a laguage, though it's not as powerful as other languages like
> perl. But ksh has its own syntax. Don't tell users the behavior of [
> -n foo bar ] is undefined. If it's undefined, just give me a syntax
> error message.

There's a difference between a syntax error from a wrong syntax
and undefined behaviour from a _syntactically valid_ but semantically
undefined construct.

> But [ -n foo bar ] does mean something because ksh
> thinks it's TRUE.
> 
> >
[snip]

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

Reply via email to