From f030a524bb81400c749addc409bc3ca6533d0325 Mon Sep 17 00:00:00 2001 From: koalaman Date: Thu, 29 Dec 2016 14:34:21 -0800 Subject: [PATCH] Created SC2194 (markdown) --- SC2194.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SC2194.md diff --git a/SC2194.md b/SC2194.md new file mode 100644 index 0000000..578f3d9 --- /dev/null +++ b/SC2194.md @@ -0,0 +1,26 @@ +## This word is constant. Did you forget the $ on a variable? + +### Problematic code: + +```sh +case foo in + bar) echo "Match" +esac +``` + +### Correct code: + +```sh +case $foo in + bar) echo "Match" +esac +``` +### Rationale: + +You are using a `case` statement to compare a literal word. + +You most likely wanted to treat this word as a `$variable` or `$(command)` instead. + +### Exceptions: + +None \ No newline at end of file