At 09:40 10/4/01 +0200, Magnus Rosenquist,,, wrote:
>Hi folks,
>
>I have some problems with the exec tag,
>I have successfully used it with native commands
>such as 'ls', 'mkdir' etc... But when it comes
>to me using a shell-script this fails.
>
>The tag looks like this:
>
><target name="ejb">
> <exec executable="/usr/local/bin/copy.sh" os="Linux">
> <arg value="1"/>
> <arg value="2"/>
> </exec>
></target>
>
>When I run ant with ejb as the target I get the following
>message:
>---------------------------------------------------------
>Buildfile: build.xml
>
>ejb:
> [exec] Result: 255
>
>BUILD SUCCESSFUL
>
>Total time: 3 seconds
>---------------------------------------------------------
>
>The result is '255' and the script is never executed,
>the script just echoes the arguments to a file.
expected behaviour on 1.1/1.2 JVMs if your working directory is same as
basedirectory or on any 1.3 JVMs. Scripts
>
>Above the full path to the script is defined, I have
>also tried with adding the script to my PATH but with
>the same problem...The script is executable and runs
>perfectly from the prompt.
>
>Does anybody have any ideas what this might mean and
>a way around it?
<target name="ejb">
<exec executable="/bin/sh" os="Linux">
<arg value="/usr/local/bin/copy.sh"/>
<arg value="1"/>
<arg value="2"/>
</exec>
</target>
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*