Skip to content

Files

Latest commit

 

History

History
29 lines (19 loc) · 486 Bytes

SC2194.md

File metadata and controls

29 lines (19 loc) · 486 Bytes

Pattern: Use of constant case statement in shell script

Issue: -

Description

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.

Example of incorrect code:

case foo in
  bar) echo "Match"
esac

Example of correct code:

case $foo in
  bar) echo "Match"
esac

Further Reading