这两天测试的时候,一个机器上同时运行了3、4个Tomcat,只好修改 $CATALINA_HOME/conf/server.xml 里的端口。
在 VIM 中用以下替换命令
:%s/\([pP]ort\)=”\(\d\{4\}\)”/\1=”3\2″/gc
全局替换端口数字长度为4的,在前面加上3。
最后面的 gc 是全局替换并且确认,去掉c就不用每次确认替换了。

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

This site uses Akismet to reduce spam. Learn how your comment data is processed.