diff --git a/SC1087.md b/SC1087.md index 3f77bf6..fea9d86 100644 --- a/SC1087.md +++ b/SC1087.md @@ -14,7 +14,7 @@ echo "${array[@]}" ### Rationale: -For compatibility reasons, `$foo[bar]` is interpreted as the variable `$foo` followed by the literal string `[bar]`. +Some languages use the syntax `$array[index]` to access an index of an arrays, but a shell will interpret this as `$array` followed by the unrelated literal string (or glob) `[index]`. Curly braces are needed to tell the shell that the square brackets are part of the expansion.