Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Arith expansion accepts extra closing parenthesis
- X-seq: zsh-workers 35354
- From: Martijn Dekker <martijn@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Arith expansion accepts extra closing parenthesis
- Date: Mon, 01 Jun 2015 18:32:14 +0200
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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