From 9d48dc568b008343ce910d5933501ed96f860aed Mon Sep 17 00:00:00 2001 From: Dalibor Pospisil Date: Mon, 8 Feb 2021 23:12:13 +0100 Subject: [PATCH] fixed backtick in quoted string (#2) Previously, the vale evaluatet the string itself. Now it evaluates just the varible name, the value is copied as it was between the quotas. --- ya.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ya.sh b/ya.sh index ccfd6c2..ddf58ce 100644 --- a/ya.sh +++ b/ya.sh @@ -327,8 +327,8 @@ __INTERNAL_yash_sanitize_value() { __INTERNAL_yash_unquote() { local var_name="$1" - if [[ "${!var_name}" =~ ^[[:space:]]*\".*\"[[:space:]]*$ ]] || [[ "${!var_name}" =~ ^[[:space:]]*\'.*\'[[:space:]]*$ ]]; then #" - eval "$var_name=${!var_name}" || { + if [[ "${!var_name}" =~ ^[[:space:]]*\"(.*)\"[[:space:]]*$ ]] || [[ "${!var_name}" =~ ^[[:space:]]*\'(.*)\'[[:space:]]*$ ]]; then #" + eval "$var_name=\${BASH_REMATCH[1]}" || { yashLogError "could not unquote ${!var_name}" return 1 }