Skip to content

Files

Latest commit

 

History

History
33 lines (22 loc) · 559 Bytes

SC1081.md

File metadata and controls

33 lines (22 loc) · 559 Bytes

Pattern: Use of capitalized Bash keyword

Issue: -

Description

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

Exceptions

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.

Further Reading