I'm trying to update a line in an xml file using a custom shell function and sed
In cmd line, I run it as follow: updateloc db_name
However it does not update anything. Below sample of the code
updateloc(){
db_name=$1
file="file.xml"
olddb="<dbname><![CDATA[olddb]]></dbname>"
newddb="<dbname><![CDATA[$db_name]]></dbname>"
sed -i '' 's/$olddb/$newdb/g' $file
}