Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Arith expansion accepts extra closing parenthesis



I just found some more arithmetic parsing strangeness. zsh 5.0.8 and
4.3.11 both happily accept and ignore one (1) extra closing parenthesis
in variable expansion within arithmetic expansion (even in POSIX mode).

% X='1)'
% echo $(($X))
1
% echo $((X))
1

(Expected output: error message in both cases)

Yet, 'echo $((1)))' errors out as expected, as do 'echo $(($X))' and
'echo $((X))' for X='1))', X='1)))', X='(1', etc.

- Martijn



Messages sorted by: Reverse Date, Date, Thread, Author