From e82d20aa7b6127355345c8b48ec6a93d39f8fd0e Mon Sep 17 00:00:00 2001 From: selfhoster1312 Date: Fri, 30 Aug 2024 19:02:53 +0200 Subject: [PATCH] Disambiguate subshell (it's not arithmetics!) --- helpers/helpers.v1.d/templating | 4 ++-- helpers/helpers.v2.1.d/templating | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers/helpers.v1.d/templating b/helpers/helpers.v1.d/templating index 76f319137..254f11463 100644 --- a/helpers/helpers.v1.d/templating +++ b/helpers/helpers.v1.d/templating @@ -267,7 +267,7 @@ ynh_read_var_in_file() { var_part+='\s*' # Extract the part after assignation sign - local expression_with_comment="$((tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" + local expression_with_comment="$( (tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" if [[ "$expression_with_comment" == "YNH_NULL" ]]; then set -o xtrace # set -x echo YNH_NULL @@ -346,7 +346,7 @@ ynh_write_var_in_file() { var_part+='\s*' # Extract the part after assignation sign - local expression_with_comment="$((tail +$after_line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" + local expression_with_comment="$( (tail +$after_line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" if [[ "$expression_with_comment" == "YNH_NULL" ]]; then set -o xtrace # set -x return 1 diff --git a/helpers/helpers.v2.1.d/templating b/helpers/helpers.v2.1.d/templating index dc7a090a2..a00cf18ca 100644 --- a/helpers/helpers.v2.1.d/templating +++ b/helpers/helpers.v2.1.d/templating @@ -216,7 +216,7 @@ ynh_read_var_in_file() { var_part+='\s*' # Extract the part after assignation sign - local expression_with_comment="$((tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" + local expression_with_comment="$( (tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" if [[ "$expression_with_comment" == "YNH_NULL" ]]; then set -o xtrace # set -x echo YNH_NULL @@ -292,7 +292,7 @@ ynh_write_var_in_file() { var_part+='\s*' # Extract the part after assignation sign - local expression_with_comment="$((tail +$after_line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" + local expression_with_comment="$( (tail +$after_line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)" if [[ "$expression_with_comment" == "YNH_NULL" ]]; then set -o xtrace # set -x return 1