[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to run Octave in a shell on MacOS Lion?
From: |
Lukas Reichlin |
Subject: |
Re: How to run Octave in a shell on MacOS Lion? |
Date: |
Sun, 16 Oct 2011 09:14:23 +0200 |
On 15.10.2011, at 18:41, Mel Bardman wrote:
> I installed Octave from the binary Octave.app for Mac OS X, version 3.4.0,
> from octave.sourceforge.net, on Lion.
>
> How can I run Octave directly from a shell, so that Octave terminal I/O goes
> to that shell? Specifically, I want to run Octave from within an Aquamacs
> shell buffer.
Copied from an earlier post on this list:
> Here's how I handle this situation, Daryl.
>
> 1. Open /Applications/Utilities/Terminal.app
> 2. In Terminal do
> $ cd /usr/local/bin
> $ sudo ln -s /Applications/Octave.app/Contents/Resources/bin/octave
>
> Now you can use the standard shebang line
> #!/usr/local/bin/octave -qf
> to run an Octave script.
>
> Regards,
>
> Vic
>
>
> On Jun 29, 2011, at 10:37 AM, Daryl Lee wrote:
>
> I'm plowing my way through the newly released "GNU Octave for Beginners"
> book, and I have run into a question that I think this group should be able
> to answer. I got to Chapter 4 and the section telling "GNU/Linux and MacOS X
> users" how to add the shebang line to their script so it can be executed from
> the bash shell.
>
> In Mac OSX, from the shell I type ($ is shell prompt)
>
> $ /Applications/Octave.app/Contents/Resources/bin/octave
>
> and get an Octave environment, as expected. But when I write a script with
> this as the first line:
>
> #! /Applications/Octave.app/Contents/Resources/bin/octave -qf
>
> set the permissions, and execute the script, I get a bash syntax error on the
> first line of Octave script following the shebang line. I've tried it with
> and without the -qf. It works as advertised on Linux, so I'm sure it's a Mac
> OSX issue.
>
> What would be an effective way to launch Octave scripts from the Mac OS X
> terminal command line?
>
> --
> Daryl Lee
After step 2, you can run octave from the shell simply by typing "octave"
Hope this helps
Lukas