Cuder
Cuder

Reputation: 163

How can I close the terminal window after launching a program using ANT's <exec>?

Using Apache ANT in Linux, I need to open a program and after that close the terminal window. The terminal command is of the kind:

#> evince /home/my.pdf & exit

I'm trying the following:

<exec executable="/bin/sh">
   <arg value="-c"/>
   <arg value="evince /home/my.pdf &amp; exit"/>
</exec>

But this immediately closes the terminal and also the application. How can I fix this?

Upvotes: 0

Views: 411

Answers (2)

ChicoSemCerebro
ChicoSemCerebro

Reputation: 11

you could try this: http://ant.apache.org/manual/Tasks/exec.html

<exec executable="/bin/sh" spawn="true">
   <arg value="-c"/>
   <arg value="nohup evince /home/my.pdf &gt;&gt; /dev/null &amp; exit"/>
</exec>

Upvotes: 1

Cuder
Cuder

Reputation: 163

This works fine:

<exec executable="/bin/sh">
   <arg value="-c"/>
   <arg value="nohup evince /home/my.pdf &gt;&gt; /dev/null &amp; exit"/>
</exec>

Upvotes: 0

Related Questions