[Top][All Lists]

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

Re: Executable octave program

From: Przemek Klosowski
Subject: Re: Executable octave program
Date: Thu, 21 Mar 2019 14:35:00 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

On 3/21/19 10:50 AM, François PH Lapointe wrote:
Good day everyone,

Base on the link
we could run an executable octave program directly from Unix command line. It should run the program in octave and then exit, right?! It should be similar to the example as 
#! octave-interpreter-name -q -f # comment
for which we are replacing 'octave-interpreter-name'  by '/usr/local/bin/octave’ . However, it does not work, or even with 

$ octave --exec-path /home/flapo/src/pism-dev4/aew4/Ref_runs/m2.m

with m2.m as an executable file similar to
#! octave-interpreter-name -qf
# a sample Octave program
printf ("Hello, world!\n");
Basically, I intend to use a huge bash script, mainly in ‘awk’, with one line for executing an octave program, exit octave, and then continuing through the bash script, all automatically. Am I using the right command script or it should be something different? 

Thank you very much for your help…

François PH Lapointe


Octave now starts with a GUI, and you need the CLI version. You can either use /bin/octave-cli or /bin/octave --no-gui

cat > m.m
#!/bin/octave-cli -qf
printf("Hello, world!\n");
address@hidden tmp]$ chmod +x m.m
address@hidden tmp]$ ./m.m
Hello, world!

Note that . is not in my PATH so I had to use explicit path.

reply via email to

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