You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by vino_hymi <vi...@gmail.com> on 2011/07/23 12:42:37 UTC

execute script in background with ANT

Hi, 

I am running script in background with exec task in ant file. But the issue
is ant target waits for the script execution to complete. 

But ideally, I want script to execute in background and move further other
targets in build.xml. 


<exec executable="/bin/bash" >  
        <arg line='-c "runprocess.sh > out.out 2 > err.txt < /dev/null &"'
/>  
</exec>  
<echo> "Done............."</echo> 

Any help? 

-Vinodh

--
View this message in context: http://ant.1045680.n5.nabble.com/execute-script-in-background-with-ANT-tp4625842p4625842.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: execute script in background with ANT

Posted by Parag Doke <pa...@gmail.com>.
The ant manual for the exec task:
http://ant.apache.org/manual/Tasks/exec.html
talks about the spawn attribute. Here is the description:
whether or not you want the command to be spawned
Default is false.
If you spawn a command, its output will not be logged by ant.
The input, output, error, and result property settings are not active
when spawning a process.
since Ant 1.6

Try:
<exec executable="/bin/bash" spawn="true">
       <arg line='-c "runprocess.sh > out.out 2 > err.txt < /dev/null &"'
/>
</exec>
<echo> "Done............."</echo>

Hope this helps,
Parag Doke
Save paper, save trees. Do not print emails/documents unless
absolutely necessary.



On Sat, Jul 23, 2011 at 4:12 PM, vino_hymi <vi...@gmail.com> wrote:
> Hi,
>
> I am running script in background with exec task in ant file. But the issue
> is ant target waits for the script execution to complete.
>
> But ideally, I want script to execute in background and move further other
> targets in build.xml.
>
>
> <exec executable="/bin/bash" >
>        <arg line='-c "runprocess.sh > out.out 2 > err.txt < /dev/null &"'
> />
> </exec>
> <echo> "Done............."</echo>
>
> Any help?
>
> -Vinodh
>
> --
> View this message in context: http://ant.1045680.n5.nabble.com/execute-script-in-background-with-ANT-tp4625842p4625842.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org