Skip to content

Files

Latest commit

 

History

History
29 lines (20 loc) · 462 Bytes

SC2284.md

File metadata and controls

29 lines (20 loc) · 462 Bytes

Pattern: Use of unquoted == after a word

Issue: -

Description

This was most likely supposed to be a comparison, so use square brackets as in the correct code.

Example of incorrect code:

if $var == value
then
  echo "Match"
fi

Example of correct code:

if [ "$var" = value ]
then
  echo "Match"
fi

Further Reading