From b726968973710d5102a40759ab02b8d82646431b Mon Sep 17 00:00:00 2001 From: koalaman Date: Sun, 14 Jun 2015 16:44:56 -0700 Subject: [PATCH] Updated SC2124 (markdown) --- SC2124.md | 2 ++ 1 file changed, 2 insertions(+) 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