Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Obscure positional-parameter assignment feature/bug
- X-seq: zsh-workers 54058
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Obscure positional-parameter assignment feature/bug
- Date: Sun, 9 Nov 2025 14:15:49 -0800
- Archived-at: <https://zsh.org/workers/54058>
- List-id: <zsh-workers.zsh.org>
Consider:
% () { 03=foo; print -l $argv } 1 2 3 4
1
2
foo
4
%
Do we want to allow leading zeros in the "names" of positional
parameters? I rather expect this was not intentional and it seems
unlikely anyone is relying on it. On the other hand prohibiting it is
presently a mildly annoying special case.
Tangentially, reference to argv[03] or even say argv[2#011] bypasses
any such restriction because the subscript is interpreted as an
integer.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author