I am trying to replace an entire description string contained in an XML file. I would like to replace that string with a variable. I am using a SED command within a Groovy script.
I have the following code. I am expecting the string "foo" to replace the description text but it doesn't. Instead the following line causes the XML to change to: Description="sDescription"
What am I doing wrong?
def sDescription = "foo"
def sedCommand = 'sed -i 's/Description="[^"]*"/Description="'$sDescription'"/g' package.appxmanifest' as String
See Question&Answers more detail:os