Ant中引号("")的处理

来源:互联网 发布:雪纺衫淘宝好评 编辑:程序博客网 时间:2024/06/06 03:27

在doc窗口运行命令

tasklist | findstr "cmd.exe" > isFinished.txt

转换为在Ant里运行,这个命令行要写在 <arg value="" /> 里,外面包裹了一层双引号"",这时候就要对命令行里的""做处理,一开始用' (单引号)代替,运行结果不对。后来查了下才发现处理的方式是:用&quot;来代替"

<exec executable="cmd" dir="${install.root.path}">    <arg value="/c" />    <arg value="tasklist | findstr &quot;cmd.exe&quot; > isFinished.txt" /></exec>
0 0
原创粉丝点击