Batch file: How to replace “=” (equal signs) and a string variable?

前端 未结 6 1816
孤独总比滥情好
孤独总比滥情好 2020-12-10 07:39

Besides SED, how can an equal sign be replaced? And how can I use a string variable in string replacement?

Consider this example:

For /F \"tokens=*\"         


        
6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 08:15

    I was looking into this, because I needed to get rid of = in a string like "test=goingon" I found that calling a next batchfile with test=goingon as parameters, I have parameters 1, "test" and 2, "goingon", in that batchfile.

    So: batchfile 1:

    @echo off
    call test2.bat test=goingon
    

    batchfile2:

    echo arg1: %1
    echo arg2: %2
    

    result:

    arg1: test
    arg2: goingon
    

提交回复
热议问题