zsh-users
 help / color / mirror / code / Atom feed
From: Dominik Vogt <dominik.vogt@gmx.de>
To: zsh-users@zsh.org
Subject: Re: Variable fails to increment with lvalue error
Date: Mon, 23 Oct 2023 17:34:24 +0100	[thread overview]
Message-ID: <ZTagkFL_Wyaw829I@localhost> (raw)
In-Reply-To: <F6518D8B-3EE2-4552-89CA-035CD50226A3@gmail.com>

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


      parent reply	other threads:[~2023-10-23 16:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 15:27 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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZTagkFL_Wyaw829I@localhost \
    --to=dominik.vogt@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).