mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2206 (markdown)
@@ -41,7 +41,7 @@ You are expanding a variable unquoted in an array. This will invoke the shell's
|
|||||||
Instead, prefer explicitly splitting (or not splitting):
|
Instead, prefer explicitly splitting (or not splitting):
|
||||||
|
|
||||||
* If the variable should become a single array element, quote it.
|
* If the variable should become a single array element, quote it.
|
||||||
* If you want to split into lines or words, use `mapfile`, `read -ra` and/or `while` loops appropriate.
|
* If you want to split into lines or words, use `mapfile`, `read -ra` and/or `while` loops as appropriate.
|
||||||
|
|
||||||
This prevents the shell from doing unwanted splitting and glob expansion, and therefore avoiding problems with data containing spaces or special characters.
|
This prevents the shell from doing unwanted splitting and glob expansion, and therefore avoiding problems with data containing spaces or special characters.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user