[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: A single instance of octave to run..
From: |
Richardson, Anthony |
Subject: |
RE: A single instance of octave to run.. |
Date: |
Fri, 28 May 2010 09:59:25 -0500 |
If working under Linux, you could have octave read input
from a FIFO (named pipe):
mkfifo octaveinput
tail -f octaveinput | octave -q --persist >& /dev/null &
cat script1 > octaveinput
echo 'drawnow;' > octaveinput
cat script2 > octaveinput
echo 'drawnow;' > octaveinput
I am assuming that you are using octave just to produce plots. If you
are interested in text results from octave don't redirect octave
output to /dev/null and don't run octave in the background. You would
then need to cat the scripts to octaveinput from another terminal.
The 'tail -f' above is necessary to keep the pipe open. The
'drawnow' commands are necessary to make the plots appear.
You can echo a 'quit' command into octaveinput
You could do something similar using netcat to send/receive octave
scripts over TCP ports and then pipe into octave. There is a version
of netcat for Windows.
Tony
> -----Original Message-----
> From: Kumaraswamy Ponnambalam [mailto:address@hidden
> Sent: Friday, May 28, 2010 9:31 AM
> To: Judd Storrs
> Cc: address@hidden
> Subject: Re: A single instance of octave to run..
>
> Hmmm..Thanks..this might work but I have to try and let you know..
>
> Thanks.
>
> Ponnu
>
> 2010/5/28 Judd Storrs <address@hidden>
>
>
> 2010/5/28 Kumaraswamy Ponnambalam <address@hidden>:
>
> > Thanks..but that won't help as the programs are invoked by by
> the user at
> > different times in a presentation...
>
>
> I think there are a number of ways to do this, but advice is
> probably
> going to depend on what we imagine you are trying to achieve.
For
> example you could use a lock file. Or concatenate the scripts
> with
> "pause" in between so that you have to press a key to continue.
> Or you
> could create a master script that sequentially steps through the
> presentation when you enter "next" or "prev". Or you could
create
> a
> menu system. It's hard to speculate.
>
>
> --judd
>
>