Bourne shells are highly sensitive to whitespace, meaning that adding or removing spaces can drastically alter the meaning of a script. ShellCheck has detected that a space is missing at the indicated position, which could lead to unexpected behavior. Correcting these whitespace issues is crucial for ensuring the script functions as intended.
1
2# Noncompliant: Missing space after `[[` in conditional expression.
3while [["$COUNT" -lt 10 ]]; do
4 echo "$COUNT"
5 ((COUNT++))
6done1
2# Compliant: Correct spacing allows proper parsing of the conditional expression.
3while [[ "$COUNT" -lt 10 ]]; do
4 echo "$COUNT"
5 ((COUNT++))
6done