Created SC2290 (markdown)

Vidar Holen
2021-07-24 13:15:29 -07:00
parent 73012a09b7
commit 1ec5313467

31
SC2290.md Normal file

@@ -0,0 +1,31 @@
## Remove spaces around = to assign.
### Problematic code:
```sh
export LC_ALL = "POSIX"
```
### Correct code:
```sh
export LC_ALL="POSIX"
```
### Rationale:
Parameters to `export`, `declare`, `local`, `typeset` and `readonly` may not have spaces around the `=` or `+=` operator. This is the same as for regular variable assignments:
export var = value # Invalid: spaces around =
export var =value # Invalid: space before =
export var= value # Invalid: space after =
export var=value # Valid
### Exceptions:
None
### Related resources:
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!