diff --git a/examples/config/src/lib/ini.sh b/examples/config/src/lib/ini.sh index 8b2df57e..752d02c6 100644 --- a/examples/config/src/lib/ini.sh +++ b/examples/config/src/lib/ini.sh @@ -47,7 +47,7 @@ ini_load() { elif [[ $line =~ $key_regex ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[2]}" - [[ $value == *\$* ]] && eval "value=\"$value\"" + [[ $value == *\$* ]] && value=$(envsubst <<<"$value") ini["${section}${key}"]="$value" fi done <"$ini_file" diff --git a/examples/ini/src/lib/ini.sh b/examples/ini/src/lib/ini.sh index 8b2df57e..752d02c6 100644 --- a/examples/ini/src/lib/ini.sh +++ b/examples/ini/src/lib/ini.sh @@ -47,7 +47,7 @@ ini_load() { elif [[ $line =~ $key_regex ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[2]}" - [[ $value == *\$* ]] && eval "value=\"$value\"" + [[ $value == *\$* ]] && value=$(envsubst <<<"$value") ini["${section}${key}"]="$value" fi done <"$ini_file" diff --git a/lib/bashly/libraries/ini/ini.sh b/lib/bashly/libraries/ini/ini.sh index 8b2df57e..752d02c6 100644 --- a/lib/bashly/libraries/ini/ini.sh +++ b/lib/bashly/libraries/ini/ini.sh @@ -47,7 +47,7 @@ ini_load() { elif [[ $line =~ $key_regex ]]; then key="${BASH_REMATCH[1]}" value="${BASH_REMATCH[2]}" - [[ $value == *\$* ]] && eval "value=\"$value\"" + [[ $value == *\$* ]] && value=$(envsubst <<<"$value") ini["${section}${key}"]="$value" fi done <"$ini_file"