| 1 | # |
| 2 | # let arithmetic. |
| 3 | |
| 4 | #### let |
| 5 | # NOTE: no spaces are allowed. How is this tokenized? |
| 6 | let x=1 |
| 7 | let y=x+2 |
| 8 | let z=y*3 # zsh treats this as a glob; bash doesn't |
| 9 | let z2='y*3' # both are OK with this |
| 10 | echo $x $y $z $z2 |
| 11 | ## stdout: 1 3 9 9 |
| 12 | ## OK zsh stdout-json: "" |
| 13 | ## OK zsh status: 1 |
| 14 | |
| 15 | #### let with () |
| 16 | let x=( 1 ) |
| 17 | let y=( x + 2 ) |
| 18 | let z=( y * 3 ) |
| 19 | echo $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 |