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. 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. But [ -n foo bar ] does mean something because ksh
thinks it's TRUE.

>
> On Fri, 1 Jun 2012 13:58:20 +0800 Clark WANG wrote:
>> For example:
>
>> $ echo ${.sh.version}
>> Version JMP 93u+ 2012-05-17
>> $
>> $ [ -n hello world ] && echo yes
>> yes
>> $
>
>> In Bash I got:
>
>> $ echo $BASH_VERSION
>> 4.2.20(1)-release
>> $
>> $ [ -n hello world ] && echo yes
>> bash: [: hello: binary operator expected
>> $
>
>> In Zsh I got:
>
>> $ echo $ZSH_VERSION
>> 4.3.12
>> $
>> $ [ -n hello world ] && echo yes
>> [: too many arguments
>> $
>> _______________________________________________
>> ast-users mailing list
>> [email protected]
>> https://mailman.research.att.com/mailman/listinfo/ast-users
>

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

Reply via email to