From help-request at octave dot org Thu Dec 2 14:43:39 2004 Subject: Re: synchronization of octave with gnuplot? From: "John W. Eaton" To: Mike Miller Cc: Thorsten Meyer , Help-Octave List Date: Thu, 2 Dec 2004 15:43:36 -0500 On 2-Dec-2004, Mike Miller wrote: | On Thu, 2 Dec 2004, Thorsten Meyer wrote: | | >> It is possible to put an 'if' statement in your script to have it | >> either "sleep(1)" or execute the awk code depending on the existence of | >> a file or the existence of an ending element in a file tail. | > | > You are right. I could have octave wait for the existence of the file. | > But as soon as it exists, I would have to keep parsing it in a loop in | > order to see if it is complete. | | But can't you then use my second suggestion and look at the file tail for | a string? For example, maybe this command... | | tail -1 file.eps | | ...always returns this string... | | %%EOF | | ...when the gnuplot process has completed. The details of how this would | be done depend on your shell. If you just want to postprocess, then why not write your awk script as a filter, then do something like gset output "| awk -f myscript.awk > foo.eps" Does that work? To get the output flushed to the pipe, you may have to issue another "gset output" command or use closeplot. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------