Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with the characters ' in value of variables #14

Open
indelog opened this issue May 16, 2018 · 1 comment
Open

Problem with the characters ' in value of variables #14

indelog opened this issue May 16, 2018 · 1 comment

Comments

@indelog
Copy link

indelog commented May 16, 2018

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}"
@mstangler
Copy link

or use "shopt -s compat42"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants