Skip to content
Joachim Ansorg edited this page Nov 12, 2021 · 2 revisions

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