Skip to content

SC2094 triggers for foo $(cat bar) > bar #473

@helpermethod

Description

@helpermethod

Hi,

ShellCheck complains about the implementation of my __inc function:

__inc() {
  printf '%d' $(($(< "$1") + 1)) > "$1"
}

As far as I understand, there is no race condition here as the read / write don't occur within the same pipe.

I would guess the $(< "$1") would first read in the value as a whole, right?

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