[英]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. 在Linux中使用Apache ANT,我需要打开一个程序,然后关闭终端窗口。 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 & exit"/>
</exec>
But this immediately closes the terminal and also the application. 但这会立即关闭终端以及应用程序。 How can I fix this?
我怎样才能解决这个问题?
you could try this: http://ant.apache.org/manual/Tasks/exec.html 您可以尝试以下方法: http : //ant.apache.org/manual/Tasks/exec.html
<exec executable="/bin/sh" spawn="true">
<arg value="-c"/>
<arg value="nohup evince /home/my.pdf >> /dev/null & exit"/>
</exec>
This works fine: 这工作正常:
<exec executable="/bin/sh">
<arg value="-c"/>
<arg value="nohup evince /home/my.pdf >> /dev/null & exit"/>
</exec>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.