Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use newline character in text in cmd batch?

Tags:

svn

batch-file

I would like to do

svn commit -m "<message>"

But message should have two lines:

Commit by: firstuser
Bug track: 9283

How to add new line character into message? I've tried SHIFT+ENTER, CTRL+T but it does not work. I use MS cmd command line.

like image 977
Tom Smykowski Avatar asked Apr 06 '09 12:04

Tom Smykowski


People also ask

How can I echo a newline in a batch file?

To create a blank line in a batch file, add an open bracket or period immediately after the echo command with no space, as shown below. Adding @echo off at the beginning of the batch file turns off the echo and does not show each of the commands. @echo off echo There will be a blank line below. echo.

How do I add a new line in CMD?

each time you press enter with a ^ at the end of the line, just press enter again to actually escape/embed a newline.

How do I use special characters in CMD?

In Windows, you can type any character you want by holding down the ALT key, typing a sequence of numbers, then releasing the ALT key.

What does @echo off do?

The ECHO-ON and ECHO-OFF commands are used to enable and disable the echoing, or displaying on the screen, of characters entered at the keyboard. If echoing is disabled, input will not appear on the terminal screen as it is typed. By default, echoing is enabled.


1 Answers

How about using the -F parameter to get the log message from a file?

Then, you could do this (untested):

ECHO Commit by: firstuser>SvnLog.txt
ECHO Bug track: 9283>>SvnLog.txt

SVN COMMIT -F SvnLog.txt
like image 125
aphoria Avatar answered Sep 20 '22 23:09

aphoria