Pattern: Use of capitalized Bash keyword
Issue: -
Shells are case sensitive and do not accept If
or IF
in place of lowercase if
.
Example of incorrect code:
If true
Then
echo "hello"
Fi
Example of correct code:
if true
then
echo "hello"
fi
If you're aware of this and insist on naming a function WHILE
, you can quote the name to prevent ShellCheck from thinking you meant while
.