Escaping an equals sign in DOS batch string replacement command

后端 未结 4 2249
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 11:20

I need to replace some text in a JNLP file using a DOS batch file to tune it for the local machine.

The problem is that the search pattern contains an equals sign wh

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-15 11:42

    Here's an alternative solution. If you can afford to download GNU tools, you can use sed:

    C:\test>set a=200
    C:\test>sed -i.bak "s/^\(.*initial-heap-size=\"\).*\( max.*\)/\1%a%\"\2/" file 
    

提交回复
热议问题