xmlstarlet replace value after pattern

后端 未结 2 455
忘掉有多难
忘掉有多难 2021-01-28 08:07

I have a pom.xml, that I want to change the properties values for tags that starting in a certain pattern.

I usually use xmlstarlet to manipulate XML bu

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-28 08:58

    I don't have xmlstartet but I can help with sed

    sed -ibak 's/\(]*>\)0.8-SNAPSHOT/\10.9-SNAPSHOT/' pom.xml
    

    will do the job and backup your original file in pom.xml.bak if needed. I you dont want this backup file, remove bak after the i flag.

提交回复
热议问题