From 2e4d47279ad9909e7b9f09a7ecd1f17b5bd4f13d Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 12 May 2018 17:05:42 -0700 Subject: [PATCH] Updated SC1087 (markdown) --- SC1087.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.