I have a Bash script:
var="
<Location /webdav/vendor1>
DAV On
AuthType Digest
AuthName "rw"
AuthUserFile /etc/password/digest-password
Require user test123456
</Location>
<Location /webdav/limited/vendor1/demo>
Dav On
AuthType Digest
AuthName "ro"
AuthUserFile /etc/password/digest-password-test2
<LimitExcept GET HEAD OPTIONS PROPFIND>
deny from all
</LimitExcept>
</Location>
"
sed -i -e "s/somestringX/${var}/g" change.txt
which returns error: sed: -e expression #1, char 9: unterminated `s' command
When $var is some single/multi-line string without special signs like /"'<>, everything works fine.
I guess that the problem is with the content of my $var, but I don't know what to do in order to make it work.
What could be the solution for this?