bash_ini_parser
bash_ini_parser copied to clipboard
Problem with the characters ' in value of variables
The substitution for the escape of ' not work.
I propose this correction :
diff --git a/read_ini.sh b/read_ini.sh
index 06b1bc8..2ae2a85 100755
--- a/read_ini.sh
+++ b/read_ini.sh
@@ -270,7 +270,7 @@ function read_ini()
# enclose the value in single quotes and escape any
# single quotes and backslashes that may be in the value
VAL="${VAL//\\/\\\\}"
- VAL="\$'${VAL/\'/\\\'}'"
+ VAL="\$'${VAL//\'/\'}'"
eval "$VARNAME=$VAL"
done <"${INI_FILE}"