call octave from shell script (with inputfile)

Francesco Potorti` Potorti at isti.cnr.it
Thu Mar 27 03:31:31 CDT 2008


>in a shell:
>
>% octave -qf octavescript.m('inputfile.dat')

It should be

% octave -qf octavescript.m inputfile.dat

>in the example inputfile.dat is a textfile with the data I want to
>process.

It will be an argument to the script.  Look at "Executable Octave
Programs" in the manual for how to use them.  Probably inside thescript
you will need something like

read(argv(){1});

>I also tried with double quotes " and without quotes...
>
>the error is:
>bash: syntax error near unexpected token `('

This is an error form the shell interpreter, it has nothing to do with
Octave.  The '(' character is special to the shell, and you should quote
it if you want to pass it as an argument to a program.  Read the bash
manual for details.  Anyway, you do not need to do that for Octave.1111111

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: Potorti at isti.cnr.it
Web: http://fly.isti.cnr.it/           Key:   fly.isti.cnr.it/public.key


More information about the Help-octave mailing list