[Top][All Lists]

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

Octave scripts in Mac OSX

From: John W. Eaton
Subject: Octave scripts in Mac OSX
Date: Wed, 29 Jun 2011 11:20:44 -0400

On 29-Jun-2011, 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/
| and get an Octave environment, as expected.  But when I write a script with 
| this as the first line:
| #! /Applications/ -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?

What's the error?

Some systems have a too-small limit (like 16 or 32) on the number of
characters that can be used in the name of the command.

One workaround is to create a symbolic link or shell script somewhere
else in the filesystem that will allow you to bypass the limit.

Another is to put Octave in your PATH and use something like

  #! /usr/bin/env octave

except then you probably won't be able to pass options in addition to
the command name.  If you need to do that, then you can use a wrapper
shell script that calls Octave with the options.

BTW, I don't think Octave can fix any of these problems.  They are all
limitations of the OS.


reply via email to

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