1

I'm attempting to execute a script from the shell (Mac OS) using Octave, and this is exactly what I type:

$ open -a octave "my_script.m"

The result, is that Octave (the full application in the GUI) opens and doesn't run the script.

Ideally, I'd like Octave to actually run in Terminal (without the GUI), and execute whatever commands and scripts I type there, including, as noted above, an entire script stored in a .m file.

I also tried the following:

$ octave-cli my_script.m

Which produces the following error:

-bash: octave-cli: command not found

I installed Octave through a DMG file linked to on the official GNU website.

1 Answer 1

1

The command you're looking for is called octave-cli, and there's no need to open, just octave-cli my_script.m.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks so much, I tried that, and this is the error I get: "-bash: octave-cli: command not found"
@Feynmanfan85 Then you need to fix your path. How did you install Octave?
Thanks @CrisLuengo, I installed using a DMG file through links provided on GNU.org - Any advice would be greatly appreciated.
If you installed Octave from a DMG, it sounds like you're running Octave.app. (That's my project!) Stick /Applications/Octave-<version>.app/Contents/Resources/usr/opt/octave-octave-app@<version>/bin on your $PATH and you should be good to go. Sorry about the inconvenient path here; Octave.app isn't primarily designed for command-line usage. Maybe we should work on that.
@AndrewJanke you deserve an "you're awesome" today: You're awesome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.