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

Re: Variable fails to increment with lvalue error



On Mon, Oct 23, 2023 at 11:27:50AM -0400, Evan Clearfield wrote:
> initialized my variable outside the loop, such that ???count=0???.
> I then increment it with a simple call ???(($count++))???, and
> when I run the script, I receive the error ???bad math expression:
> lvalue required???

Use ((count++)) instead of (($count++)).

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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