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

Re: Possible bug in 5.8



On Mon, Dec 20, 2021 at 01:17:53PM +0000, Simon Chatterjee 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 `/???

Doesn't happen with my config and 5.8.  There's most likely an
integer declaration for that variable in some file.  Look out for

  typeset -i i

or

  integer i

> This isn't a problem in 5.7.1. It looks like the variable ???i??? is
> special-cased to encourage an arithmetic expression evaluation.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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