Revert "Fix variable reading in case VAR is specified multiple times in file."
All checks were successful
continuous-integration/drone/push Build is passing
gitea/evobackup/pipeline/head This commit looks good

This reverts commit 89580f2929.
This commit is contained in:
William Hirigoyen 2022-08-26 18:05:14 +02:00
parent 89580f2929
commit 5739b8afe2

View file

@ -445,7 +445,7 @@ read_variable() {
pattern="^\s*${var_name}=.+" pattern="^\s*${var_name}=.+"
grep --extended-regexp --only-matching "${pattern}" "${file}" | tail -1 | cut -d= -f2 | head -1 grep --extended-regexp --only-matching "${pattern}" "${file}" | tail -1 | cut -d= -f2
} }
read_numerical_variable() { read_numerical_variable() {
@ -454,5 +454,5 @@ read_numerical_variable() {
pattern="^\s*${var_name}=-?[0-9]+" pattern="^\s*${var_name}=-?[0-9]+"
grep --extended-regexp --only-matching "${pattern}" "${file}" | tail -1 | cut -d= -f2 | head -1 grep --extended-regexp --only-matching "${pattern}" "${file}" | tail -1 | cut -d= -f2
} }