help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invoke an octave session via pipe


From: George Kousiouris
Subject: Re: Invoke an octave session via pipe
Date: Fri, 8 May 2009 10:51:25 +0300 (EEST)
User-agent: SquirrelMail/1.5.1

I am not sure if this will help you, I have not worked before with
interactive mode,with the octave prompt,or pipes but what I have done is
to run the octave script from Windows command line like:
c:\>octave script.m

In the beginning I had defined the script.m as a function, which lead to
invoking octave but not executing the script. Octave started but suddenly
it stopped before actually executing the script. This was fixed by
removing the function definition from the beginning of the m file. Then it
executed normally.

George

On Fri, May 8, 2009 02:16, Qianqian Fang wrote:
> thank you John, and also Michael's reply for using the -i option.
>
> I tried -i and my initial pipe read returned the "octave:1>" prompt,
> however, sending commands via my pascal function still failed to give me
> any more output to read.
>
> I am not sure I understood the the experiment outlined in your reply.
> I ran the "octave --interactive < fifo > foo.out " command and it simply
> gave an empty foo.out file; I did not have chance to run the cat command
> from another term and octave already quit.
>
> In the past, I only got succeed using pipes to run a .m file from
> command line and retrieve the printed results, but that was a single
> execution; but now what I am trying to achieve is to interact with an
> persistent session (sort of like a GUI), I am not sure if this is indeed
> possible with pipe operations.
>
> I also found some possible issues on the pascal side, I posted it
> on the Lazarus forum and I will let you know if I get any useful feedback
> from there.
>
> Qianqian
>
>
>
> John W. Eaton wrote:
>
>> On  7-May-2009, Qianqian Fang wrote:
>>
>>
>> | What makes me curious is why my stdout reading did not give me the
>> | octave prompt, i.e. "octave:1>"? looks like once octave get started,
>> | it will start something else, which I can not access its stdout via
>> | octave's stdout.
>>
>>
>> No, I think Octave writes the prompt and most output to stdout.
>> Probably you want to use the --interactive option when talking to
>> Octave over a pipe.  If you are on a Unixy system, try this
>> experiment:
>>
>>
>> in one terminal window, run
>>
>> mkdir fifo octave --interactive < fifo > foo.out
>>
>> and in another, type
>>
>> cat > fifo svd (rand (3)) fprintf (stderr, "stderr!\n")
>>
>> and then look at foo.out.  It should contain all of Octave's output
>> except the "stderr!" message, which should have been printed to the
>> terminal where you started Octave.
>>
>> jwe
>>
>>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>


----

George Kousiouris
Research Associate
Division of Communications,
Electronics and Information Engineering
School of Electrical and Computer Engineering
Tel: +30 210 772 2546
Mobile: +30 6939354121
Fax: +30 210 772 2569
E-mail: address@hidden

National Technical University of Athens
9 Heroon Polytechniou str., 157 73 Zografou, Athens, Greece




reply via email to

[Prev in Thread] Current Thread [Next in Thread]