Linux – Use linefeed or carriage return in Subversion commit message from the command line

bashcommand-line-interfacelinuxsvn

I am using Subversion 1.6.6 on Ubuntu 10.04, running a bash shell. I would like to insert a carriage return, or linefeed, or newline into my commit message so that when reading the log, the comments are formatted appropriately. It works fine when I use the system editor, or specify a file for the commit comment, but what I really want is to be able to do something like the following:

svn ci -m "This is the first line\nThis is the second line"

and have the comment presented as:

This is the first line
This is the second line

My example does not work, it produces output:

This is the first line\nThis is the
second line

So, is there a way to do this? If so, how?

Best Answer

Try this:

svn ci -m $'This is the first line\nThis is the second line'