From 1ec5313467b3d6a7f9c8ac3bf0b911a9260c6781 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 24 Jul 2021 13:15:29 -0700 Subject: [PATCH] Created SC2290 (markdown) --- SC2290.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 SC2290.md diff --git a/SC2290.md b/SC2290.md new file mode 100644 index 0000000..37881df --- /dev/null +++ b/SC2290.md @@ -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! \ No newline at end of file