Skip to content
koalaman edited this page Dec 29, 2016 · 1 revision

This word is constant. Did you forget the $ on a variable?

Problematic code:

case foo in
  bar) echo "Match"
esac

Correct code:

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

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally
You can’t perform that action at this time.