OILS / spec / let.test.sh View on Github | oilshell.org

23 lines, 9 significant
1#
2# let arithmetic.
3
4#### let
5# NOTE: no spaces are allowed. How is this tokenized?
6let x=1
7let y=x+2
8let z=y*3 # zsh treats this as a glob; bash doesn't
9let z2='y*3' # both are OK with this
10echo $x $y $z $z2
11## stdout: 1 3 9 9
12## OK zsh stdout-json: ""
13## OK zsh status: 1
14
15#### let with ()
16let x=( 1 )
17let y=( x + 2 )
18let z=( y * 3 )
19echo $x $y $z
20## stdout: 1 3 9
21## status: 0
22## N-I mksh/zsh stdout-json: ""
23## N-I mksh/zsh status: 1