SC2194 – ShellCheck Wiki

See this page on GitHub

Sitemap


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 is a static analysis tool for shell scripts. This page is part of its documentation.