How to use newline character in text in cmd batch?

后端 未结 12 1919
忘掉有多难
忘掉有多难 2020-12-31 07:08

I would like to do

svn commit -m \"\"

But message should have two lines:

Commit by: firstuser
Bug track: 92         


        
12条回答
  •  我在风中等你
    2020-12-31 07:18

    You can define the newline as follows:

    set newline=^& echo.
    

    Then, you can use the newline in other statements, like this: (no quotes)

    echo This is the first line%newline%This is the second line
    echo "This is the first line"%newline%"This is the second line"
    

    or with an extra caret, like this:

    set text=This is the first line^%newline%This is the second line
    

    Perhaps you can play with that, but mind the combination with quotes!

提交回复
热议问题