mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +00:00
Merge pull request #13 from tests-always-included/fix-array-slicing
Fixing the array slicing for Bash 3
This commit is contained in:
commit
62478ba084
7
mo
7
mo
@ -338,7 +338,12 @@ moIndirect() {
|
|||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
moIndirectArray() {
|
moIndirectArray() {
|
||||||
unset -v "$1"
|
unset -v "$1"
|
||||||
eval "$1=(\"\${@:2}\")"
|
|
||||||
|
# IFS must be set to a string containing space or unset in order for
|
||||||
|
# the array slicing to work regardless of the current IFS setting on
|
||||||
|
# bash 3. This is detailed further at
|
||||||
|
# https://github.com/fidian/gg-core/pull/7
|
||||||
|
IFS= eval "$1=(\"\${@:2}\")"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user