[Gambas-user] execute shell command then exit

Steven Lobbezoo steven at ...1652...
Mon Aug 18 15:02:36 CEST 2008

OOffice does it like this :

# execute soffice binary
"$sd_prog/$sd_binary" "$@" &
trap 'kill -9 $!' TERM
wait $!


Le samedi 16 août 2008 à 19:30 +0200, Benoit Minisini a écrit :

> On samedi 16 août 2008, joshiggins wrote:
> > I'm making a menu replacement which I will call from a launcher on the xfce
> > panel, and if it doesnt exit after starting the selected program it will
> > still be running, then pressing the launcher again will make two menu
> > processes, but only 1 will be visible to the user. This is my problem.
> >
> > My gambas program strangely doesnt exit when the process it started exits.
> > Is this normal behaviour?
> >
> It depends. As I explained, your launcher is the parent process of the started 
> programs, so it is waiting for the end of its children. When all its children 
> have terminated, the parent will end. Otherwise, it means than some watched 
> file descriptor (a process, a pipe) or a window is already opened in your 
> program.

More information about the User mailing list