From b17d618d9f824a91f48442c5747be6c54e5823c4 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Thu, 19 Nov 2020 13:27:34 -0800 Subject: [PATCH] Updated SC2124 (markdown) --- SC2124.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SC2124.md b/SC2124.md index f24099a..a634a2e 100644 --- a/SC2124.md +++ b/SC2124.md @@ -48,7 +48,7 @@ Since doing this usually indicates a bug, ShellCheck warns and asks you to be ex If you want to assign N elements as N elements in Bash or Ksh, use an array, e.g. `myArray=( "$@" )`. -Dash and POSIX sh do not support arrays. In this case, either concatenate the values with some delimiter that you can split on later (the example uses linefeeds and splits them back up with a `while read` loop), or keep the values as positional parameters without putting them in an array. +Dash and POSIX sh do not support arrays. In this case, either concatenate the values with some delimiter that you can split on later (the example uses linefeeds and splits them back up with a `while read` loop), or keep the values as positional parameters without putting them in an intermediate variable. If you want to assign N elements as 1 element by concatenating them, use `*` instead of `@`, e.g. `myVar=${myArray[*]}` (this separates elements with the first character of `IFS`, usually space).