Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible bug in 5.8
- X-seq: zsh-users 27425
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: "Simon Chatterjee" <jal@xxxxxxxxxx>
- Cc: "Zsh Users" <zsh-users@xxxxxxx>, "Roman Perepelitsa" <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: Possible bug in 5.8
- Date: Mon, 20 Dec 2021 18:23:03 +0000
- Archived-at: <https://zsh.org/users/27425>
- In-reply-to: <CAN=4vMruW3wh0dwN8yPAUiZ8Mzki9Lj98-_6mKmvNMuX9N9ELg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CABA_rhBmM7pivrZ9jXCaUV1M18_e7d+iEU2m6tCnH=eMjme-Gw@mail.gmail.com> <CAN=4vMruW3wh0dwN8yPAUiZ8Mzki9Lj98-_6mKmvNMuX9N9ELg@mail.gmail.com>
Roman Perepelitsa wrote on Mon, 20 Dec 2021 13:28 +00:00:
> On Mon, Dec 20, 2021 at 2:18 PM Simon Chatterjee <jal@xxxxxxxxxx> wrote:
>>
>> Zsh 5.8 seems to have a problem with the variable ‘i’, in a ‘for … in’
>> loop, where an item being iterated over starts with a ‘/‘:
>>
>> % zsh --version
>> zsh 5.8 (x86_64-pc-linux-gnu)
>> % for p in /; do echo $p; done
>> /
>> % for i in /; do echo $i; done
>> zsh: bad math expression: operand expected at `/‘
>
> Works fine for me:
>
> % docker run --rm zshusers/zsh:5.8 zsh -c 'for i in /; do echo $i; done'
> /
>
> Try reproducing this from `zsh -f`. If you cannot, run `typeset -p i`
> in your shell. You'll probably see that it's defined. Since `zsh -f`
> doesn't have this parameter, it must be defined in rc files.
So, run «zsh -x» and look for «i» in the trace output (as a whole word).
You could try your luck with «zsh -o WARN_CREATE_GLOBAL». It won't help
if someone _deliberately_ made «i» global, but it would catch implicit
creations of a global integer parameter (e.g., in arithmetic contexts).
The way to report bug is to post them to this list.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author