Executing .m files from the bash shell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Executing .m files from the bash shell

Krishnaprasad
Hello all,

I followed the standard procedure to execute .m file from the bash shell which is by adding #! /usr/local/bin/octave -qf at the beginning of the file and set the permissions of the file to 755. When I executed ./<name of the function / .m file>, it did not work. The .m file contains several sub functions that are internally used for the overall execution. I also tried using octave <name of the .m file> but it gives an error that displays "nested functions not implemented in this context".

I am able to execute the .m file if I use it from the octave shell and as well as the octave gui.

Can I kindly know the procedure to execute .m files from the bash shell?

Regards,
Krishnaprasad
Reply | Threaded
Open this post in threaded view
|

Re: Executing .m files from the bash shell

Juan Pablo Carbajal-2
Hi,
I think the error is quite verbose:

On Fri, Sep 26, 2014 at 1:08 PM, Krishnaprasad <[hidden email]> wrote:
"nested functions not implemented in this context".

Try to write your function without nested functions and try again.
Also, please remember that magic crystal balls were banned form this community so you have to provide code examples if you want concrete help.


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Executing .m files from the bash shell

Dave Cottingham 2
In reply to this post by Krishnaprasad
First, trying executing

/usr/local/bin/octave -qf <your file name here>

If that doesn't work, then just executing the file won't work either.

About nested functions: I don't use them, so I'm no authority, but I've heard that functions defined in scripts may not be nested. If that's so, you could solve that problem by removing your nested function to a separate function file.