ANT 执行SHELL脚本
solaris环境
[1]vi test.sh
echo My name is $1
echo My age is $2
[2] chmod a+x test.sh
[3] vi build.xml
<?xml version="1.0" ?>
<project name="shell" default="test_shell" basedir=".">
<target name="test_shell">
<echo>deploy clean axis service</echo>
<exec executable="${basedir}/test.sh" failonerror="true">
<arg value="test1" />
<arg value="test2" />
</exec>
</target>
</project>
solaris环境
[1]vi test.sh
echo My name is $1
echo My age is $2
[2] chmod a+x test.sh
[3] vi build.xml
<?xml version="1.0" ?>
<project name="shell" default="test_shell" basedir=".">
<target name="test_shell">
<echo>deploy clean axis service</echo>
<exec executable="${basedir}/test.sh" failonerror="true">
<arg value="test1" />
<arg value="test2" />
</exec>
</target>
</project>

本文介绍了一个使用ANT工具执行SHELL脚本的具体示例。该示例展示了如何在Solaris环境下通过ANT调用带有参数的SHELL脚本,并实现自动化部署任务。文章中的build.xml文件配置了执行test.sh脚本所需的参数。
4637

被折叠的 条评论
为什么被折叠?



