Skip to content

commas in arithmetic expansions are non-POSIX #3499

Description

@Rudxain

For bugs with existing features

Here's a snippet or screenshot that shows the problem:

#!/bin/sh
: $((x=1,y=2))

Here's what shellcheck currently says:

In tmp line 2:
: $((x=1,y=2))
      ^-- SC2034 (warning): x appears unused. Verify use (or export if used externally).
          ^-- SC2034 (warning): y appears unused. Verify use (or export if used externally).

For more information:
  https://www.shellcheck.net/wiki/SC2034 -- x appears unused. Verify use (or ...

Here's what I wanted or expected to see:

Some warning in the range SC30*, saying that the comma operator is not guaranteed by POSIX. I get an error in dash, but not bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions