Tried with following code:
revision=(revision="5.0")
sed -i "s/revision="1.0"/${revision}/g" /File-path/composite.xml)
But In the file the contents of revision="1.0" is replaced by ${revision}
Need to quote: "
sed -i "s/revision=\"1.0\"/${revision}/g" /File-path/composite.xml
But In the file the contents of revision="1.0" is replaced by ${revision}, he made typo in his question.-i switch tell sed to execute infile replacement.(...) tell bash to store an array of variables.) seem wrong.My purpose:
revision='revision="5.0"'
sed -e "s/revision=\"[0-9.]*\"/${revision}/g" /File-path/composite.xml
or if you want file /File-path/composite.xml to be modified:
sed -e "s/revision=\"[0-9.]*\"/${revision}/g" -i /File-path/composite.xml
or even:
sed -e "s/revision=\"[0-9.]*\"/${revision}/g" -i.bak /File-path/composite.xml
sedscript.