i'm using xmlstarlet into a shell script to parse an xml file untitled app.xml with this command, just to get the content of which is a string , and store it on "my_var" :
my_var=`xmlstarlet sel -t -m "//root/services/service[position=$i]" -v description -n /home/wissem/Bureau/app.xml`
then ,when trying to modify an other xml file untitled strings.xml with the output of the last command , using this command line :
find /root/AndroidStudioProjects/FacebookMenu/app/src/main/res/values/strings.xml -type f -exec perl -pi -w -e 's/name=\"text_'$i'\".*\<\/string\>/name=\"text_'$i'\"\>'$my_var'\<\/string\>/g' {} \;
i get the following error :
Substitution replacement not terminated at -e line 1.
i tried to understand the problem by changing severally the string that i'm parsing into my variable , i noticed that the problem appears when i have a "space" on the string !
to explain more :for this_is_my_string : it works
for this is my string : i get the error.