diff --git a/SC2124.md b/SC2124.md index 2941551..e4b95b3 100644 --- a/SC2124.md +++ b/SC2124.md @@ -32,6 +32,8 @@ If you want to assign N elements as N elements, use an array, e.g. `myArray=( "$ 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). +The same is true for `${@: -1}`, which results in 0 or 1 elements: `var=${*: -1}` assigns the last element or an empty string. + ### Exceptions None. \ No newline at end of file