From e8dba2c2d185149d32fbaae00114ed994b62d3af Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Fri, 11 Dec 2020 20:34:15 -0800 Subject: [PATCH] Created SC2269 (markdown) --- SC2269.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 SC2269.md diff --git a/SC2269.md b/SC2269.md new file mode 100644 index 0000000..b7fcb1b --- /dev/null +++ b/SC2269.md @@ -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! \ No newline at end of file