Pattern: Use of [ ]
instead of false
Issue: -
[ ]
is a somewhat obscure way of expressing falsehood, and the behavior is likely intended to allow the incorrectly quoted command [ $var ]
to still work when the variable is unset.
POSIX has a more descriptive command false
for this.
Example of incorrect code:
if [ ]
then
echo "Temporarily disabled"
fi
Example of correct code:
if false
then
echo "Temporarily disabled"
fi