mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 11:19:45 +08:00
Created SC1081 (markdown)
23
SC1081.md
Normal file
23
SC1081.md
Normal file
@@ -0,0 +1,23 @@
|
||||
## Scripts are case sensitive. Use 'if', not 'If'.
|
||||
|
||||
### Problematic code:
|
||||
|
||||
If true
|
||||
Then
|
||||
echo "hello"
|
||||
Fi
|
||||
|
||||
### Correct code:
|
||||
|
||||
if true
|
||||
then
|
||||
echo "hello"
|
||||
fi
|
||||
|
||||
### Rationale:
|
||||
|
||||
Shells are case sensitive and do not accept `If` or `IF` in place of lowercase `if`.
|
||||
|
||||
### Contraindications
|
||||
|
||||
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`.
|
Reference in New Issue
Block a user