I am trying to replace the entire description line contained in an XML file. I would like to replace this string with a variable. I am using the SED command in a Groovy script.
I have the following code. I expect the string "foo" to replace the description text, but it is not. Instead, the following line changes the XML: Description = "sDescription"
What am I doing wrong?
def sDescription = "foo" def sedCommand = 'sed -i \'s/Description="[^"]*"/Description="'$sDescription'"/g\' package.appxmanifest' as String
Groovy / () . ('content') . , ("content"), , :
'content'
"content"
def sDescription = "foo" def sedCommand = "sed -i 's/Description=\"[^\"]*\"/Description=\"$sDescription\"/g\' package.appxmanifest" as String
, , . , (\) , .
\
: @tim_yates, , Groovy XML-, ?
Source: https://habr.com/ru/post/1662451/More articles:Want a transparent image even after mixing - c ++Image of a layer with opacity on top of another image. - OpenCV - pythonjenkins escape sed team - escapingExpand for 1 minute, calculate the average value - timehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1662450/oop-what-is-top-of-the-class-hierarchy-called&usg=ALkJrhgC11yFBGokugicCq9Y7b3HKSTR8wStructures in C ++ * - c ++Reconfiguring JSON parsing - jsonHow to include test classes in shadowJar? - javaAndroid AlarmManager does not work when the phone is sleeping - androidsendWakefulWork is not always called with cwac-wakeful-1.1.0 - androidAll Articles