Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Numbers with leading _
On 11/21/22, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
>> On 21/11/2022 16:22 Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> I was playing with extending hasbraces+xpandbraces to allow _ in
>> numbers via zstrtoul_underscore, and noticed that in normal math
>> context, this happens:
>> % echo $(( _1000 ))
>> 0
>> % a=(1 2 3); echo $a[_1]
>>
>
> That's a reference to the variable $_1 (which obviously isn't set).
Aha, that indeed does make sense now, thanks.
% _1000=5
% echo $(( _1000 ))
5
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author