I'm trying to run the following command from an Ant build file:
sh /home/myuser/scripts/run.sh -p=8888 -z=true /home/myuser/resources/mydir
So far here's my best attempt:
<target name="run">
<exec executable="/bin/bash">
<arg line="/home/myuser/scripts/run.sh"/>
<arg line="-p=8888"/>
<arg line="-z=true"/>
<arg line="/home/myuser/resources/mydir"/>
</exec>
</target>
When I run this, I don't get any Ant output, except a BUILD SUCCESSFUL
message. However, running this script from a terminal produces loads of output. I'm not sure if I've set up the <exec/>
task correctly, or how to even begin debugging this. Thanks in advance.
Update when I run ant in verbose mode, I get the following output:
[exec] Current OS is Linux
[exec] Executing '/bin/bash' with arguments:
[exec] '/home/myuser/scripts/run.sh'
[exec] '-p=8888'
[exec] '-z=true'
[exec] '/home/myuser/resources/mydir'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
[exec] Usage: <run> [options] <your dir>
So it looks like Ant is inserting single quotes around my arguments. Any way to disable this behavior?