Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Waiting on Child

2008/5/28 Chris Johnson <cjohnson@xxxxxxxxxx>:
> I've got a script that opens in the foreground a file in OpenOffice.org.
> When the process ends, I do some other things to the file.  This all
> worked great until I upgraded to OpenOffice 2.4.  It seems now that a
> child process is spawned to deal with the document and the parent
> process does not wait for the child.  The parent process ends and my
> script now incorrectly advances to the post-editing code.
> Is there anything zsh can do to help me?  I want to be able to wait on
> the child process, but I don't think zsh can do anything about it.
> Probably I can twiddle with checking the output of ps, but ps-based
> scripts rarely seem portable.
> Any ideas?  Thanks.

Looks like ooffice is communicating with an existing ooffice process
via the OSL_PIPE_* socket in /tmp, so I doubt there's anything you can
do to notice it closed the file... You could possibly use
inotifywait[1] to watch for an appropriate event (i think

[1] http://inotify-tools.sourceforge.net/

Mikael Magnusson

Messages sorted by: Reverse Date, Date, Thread, Author