fix local vars
This commit is contained in:
parent
856d5172eb
commit
00d8162e99
@ -2,7 +2,7 @@ function g_array {
|
|||||||
local g_filename=$1
|
local g_filename=$1
|
||||||
local g_arrayname=$2
|
local g_arrayname=$2
|
||||||
local g_delimeter=$3
|
local g_delimeter=$3
|
||||||
local g_array
|
unset g_array
|
||||||
|
|
||||||
[ -n "$g_delimeter" ] && g_delimeter="-d${g_delimeter}"
|
[ -n "$g_delimeter" ] && g_delimeter="-d${g_delimeter}"
|
||||||
if [ -f "$g_filename" ]
|
if [ -f "$g_filename" ]
|
||||||
@ -14,7 +14,7 @@ function g_array {
|
|||||||
|
|
||||||
# remove newlines
|
# remove newlines
|
||||||
g_array=("${g_array[@]%$'\n'}")
|
g_array=("${g_array[@]%$'\n'}")
|
||||||
declare -n $g_arrayname=g_array
|
declare -ng $g_arrayname=g_array
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user