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

Re: Possible bug in 5.8



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.

Roman.




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