【问题标题】:How to display quote (") symbol in ant script如何在 ant 脚本中显示引号 (") 符号
【发布时间】:2011-12-19 09:09:38
【问题描述】:

我的蚂蚁脚本是,

<target name="temp">
    <property name="argument" value="xyz abc"/>
    <echo message=" & quot;${argument}& quot;"/>
</target>

输出是

xyz abc

预期输出是

"xyz abc"

如何获得预期的输出。我试过这样&amp;quot;quot;${argument}&amp;quot;quot;,这也行不通。

注意:我在 Windows 7 中使用 ant 1.8.2 和 antcontrib

【问题讨论】:

  • 已更新。删除了一些错误。

标签: scripting ant escaping properties quotes


【解决方案1】:

&amp;quot; 之间有空格吗?

这对我有用:

<target name="temp">
    <property name="argument" value="xyz abc"/>
    <echo message="&quot;${argument}&quot;"/>
</target>

输出:

temp:
     [echo] "xyz abc"
BUILD SUCCESSFUL
Total time: 469 milliseconds

【讨论】:

    猜你喜欢
    • 2018-11-15
    • 1970-01-01
    • 2017-04-18
    • 2021-06-26
    • 2010-11-25
    • 1970-01-01
    • 2018-03-12
    • 1970-01-01
    • 2017-05-15
    相关资源
    最近更新 更多