On 1 June 2012 06:58, Clark WANG <[email protected]> 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
> $
It's unspecified behaviour, so all bets are off.
When there are 3 arguments to 'test' then then either:
- the middle one must be a valid binary operator (like '-gt'); or,
- the first one is '!';, or,
- the three arguments are '(' something ')'.
David Jones
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users