Created SC2269 (markdown)

Vidar Holen
2020-12-11 20:34:15 -08:00
parent 12f95885ba
commit e8dba2c2d1

28
SC2269.md Normal file

@@ -0,0 +1,28 @@
## This variable is assigned to itself, so the assignment does nothing.
### Problematic code:
```sh
var="$var"
```
### Correct code:
```sh
# 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.
### Related resources:
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!