zsh-users
 help / color / mirror / code / Atom feed
* Variable fails to increment with lvalue error
@ 2023-10-23 15:27 Evan Clearfield
  2023-10-23 15:33 ` Roman Perepelitsa
  2023-10-23 16:34 ` Dominik Vogt
  0 siblings, 2 replies; 6+ messages in thread
From: Evan Clearfield @ 2023-10-23 15:27 UTC (permalink / raw)
  To: zsh-users

I’m in the process of creating a shell script on macOS Sonoma. I’m just implementing a simple counter in a for loop. I 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”

Any idea what I’m doing wrong? I’ve searched high and low, tried multiple variations of the “((count++))” expression, changed my initial number, etc. Nothing seems to work.

HELP
Sent from my iPhone

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-10-23 18:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-23 15:27 Variable fails to increment with lvalue error Evan Clearfield
2023-10-23 15:33 ` Roman Perepelitsa
2023-10-23 16:43   ` Peter Stephenson
2023-10-23 17:03     ` Roman Perepelitsa
2023-10-23 18:21       ` Ray Andrews
2023-10-23 16:34 ` Dominik Vogt

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).