fix local vars

This commit is contained in:
olli 2024-04-25 10:59:52 +02:00
parent 856d5172eb
commit 00d8162e99

View File

@ -2,7 +2,7 @@ function g_array {
local g_filename=$1
local g_arrayname=$2
local g_delimeter=$3
local g_array
unset g_array
[ -n "$g_delimeter" ] && g_delimeter="-d${g_delimeter}"
if [ -f "$g_filename" ]
@ -14,7 +14,7 @@ function g_array {
# remove newlines
g_array=("${g_array[@]%$'\n'}")
declare -n $g_arrayname=g_array
declare -ng $g_arrayname=g_array
}