我使用bash和Ant,我想执行这个命令
<exec dir="../../../path/to/" executable="./configure">
<arg line="--prefix=$(readlink -f ./../../../Applications/common/lg-media-server/rpmbuild/pp)"/>
</exec>
它不起作用。有人能帮我吗?
问题是Ant不像shell那样解释命令行参数。在调用configure之前,必须首先通过Ant评估$(readlink -f ./../../../Applications/common/lg-media-server/rpmbuild/pp)
。
类似这两个步骤的东西应该做的工作:
<exec executable="readlink" outputproperty="pp_path">
<arg line="-f ./../../../Applications/common/lg-media-server/rpmbuild/pp"/>
</exec>
<exec dir="../../../path/to/" executable="./configure">
<arg line="--prefix=${pp_path}"/>
</exec>