通过运行EXEC蚂蚁多个命令 [英] Run multiple commands through Ant exec

查看:158
本文介绍了通过运行EXEC蚂蚁多个命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过一个Ant构建脚本来做到这一点:

I want to do this through an Ant build script:

$ /bin/sh
$ cd /path/to/executable
$ ./executable.sh

这是我试过,但我认为这只是执行 CD 命令:

This is what I tried but I think it only executes the cd command:

<exec executable="/bin/sh" os="Mac OS X">
    <arg value="-c"/>
    <arg value="cd /path/to/executable"/>
    <arg value="./executable.sh"/>
</exec>

我在Mac OS X上。

I am on Mac OS X.

推荐答案

只有 -c 由shell中运行后,因此你看到行为的第一个参数。只要把两个命令为一个ARG,用分号隔开:

Only the first arg after the -c is run by the shell, hence the behaviour you see. Just put the two commands into one arg, separated by a semicolon:

<exec executable="/bin/sh" os="Mac OS X">
    <arg value="-c"/>
    <arg value="cd /path/to/executable; ./executable.sh"/>
</exec>

这篇关于通过运行EXEC蚂蚁多个命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆