I am (unsuccessfully) trying to substitute the database host entry in a Magento local.xml file (the connection string file).
The line is the following:
&
With GNU sed:
sed 's|\(<host><!\[CDATA\[\).*\(\]\]></host>\)|\1lala\2|' file
or
sed -E 's|(<host><!\[CDATA\[).*(\]\]></host>)|\1lala\2|' file
Output:
<host><![CDATA[lala]]></host>