Skip to content

Commit

Permalink
Disambiguate subshell (it's not arithmetics!)
Browse files Browse the repository at this point in the history
  • Loading branch information
selfhoster1312 committed Aug 30, 2024
1 parent aff885e commit e82d20a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions helpers/helpers.v1.d/templating
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions helpers/helpers.v2.1.d/templating
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e82d20a

Please sign in to comment.