call octave from shell script (with inputfile)

Ben Abbott bpabbott at mac.com
Wed Mar 26 12:16:52 CDT 2008


On Mar 25, 2008, at 10:02 AM, Michael Bock wrote:

>
> ---  sorry for cross posting (it's my first one...)  ---
>
> Hello everybody,
>
> I'm quite new to Octave and the list and I have a problem calling  
> octave
> from a shell script. I have a octave script which is running  
> properly when
> run from octave's prompt. I also can call an octave "Hello world"  
> script
> from a shell script. However I cannot call a octave script and  
> giving it an
> inputfile from the shell. I tried several quotings like this one:
>
> in a shell:
>
> % octave -qf octavescript.m('inputfile.dat')
>
> in the example inputfile.dat is a textfile with the data I want to  
> process.
> I also tried with double quotes " and without quotes...
>
> the error is:
> bash: syntax error near unexpected token `('
>
> I'm doing this on ubuntu 7.10 with octave 2.9.12
>
> Any useful hints are very much appreciated!!
>
> Michael
> -- 

Try

	octave --silent --eval 'octavescript("inputfile.dat")'

The form you tried is for scripts, not for functions.

Ben

Ben




More information about the Help-octave mailing list