SC2269 – ShellCheck Wiki

See this page on GitHub

Sitemap


This variable is assigned to itself, so the assignment does nothing.

Problematic code:

var="$var"

Correct code:

# If the goal is to do nothing
true

Rationale:

ShellCheck found a variable that is assigned to itself, e.g. x=$x. This obviously has no effect.

Double check what the assignment was supposed to do.

Exceptions:

None.


ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.