koalaman / shellcheck Public
SC2269
Vidar Holen edited this page Dec 12, 2020
·
1 revision
This variable is assigned to itself, so the assignment does nothing.
Problematic code:
var="$var"Correct code:
# If the goal is to do nothing
trueRationale:
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.
Related resources:
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!