mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC1087 (markdown)
@@ -1,4 +1,4 @@
|
|||||||
## Braces are required when expanding arrays, as in ${array[idx]}.
|
## "Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet)."
|
||||||
|
|
||||||
### Problematic code:
|
### Problematic code:
|
||||||
|
|
||||||
@@ -20,4 +20,6 @@ Curly braces are needed to tell the shell that the square brackets are part of t
|
|||||||
|
|
||||||
### Exceptions
|
### Exceptions
|
||||||
|
|
||||||
If you want the square brackets to be treated literally or as a glob, you can use `${var}[idx]` to prevent this warning.
|
If you want the square brackets to be treated literally or as a glob, use `${var}[idx]` to prevent this warning.
|
||||||
|
|
||||||
|
This does not change how the script works, but clarifies your intent to ShellCheck as well as other programmers.
|
Reference in New Issue
Block a user