從命令列在 Subversion 提交訊息中使用換行符或回車符

從命令列在 Subversion 提交訊息中使用換行符或回車符

我在 Ubuntu 10.04 上使用 Subversion 1.6.6,運行 bash shell。我想在提交訊息中插入回車符、換行符或換行符,以便在閱讀日誌時,註釋的格式正確。當我使用系統編輯器或為提交註釋指定文件時,它工作得很好,但我真正想要的是能夠執行以下操作:

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

並將評論呈現為:

This is the first line
This is the second line

我的範例不起作用,它會產生輸出:

這是第一行\n這是第二行

那麼,有辦法做到這一點嗎?如果是這樣,怎麼辦?

答案1

嘗試這個:

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

答案2

鍵入時只需按 Enter 鍵,而不是 \n。提示符號將變為“>”,您可以繼續輸入。

這是一個 shell 問題,而不是 Subversion 問題。

相關內容