help-octave
[Top][All Lists]
Advanced

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

shebangs calling octave.app (was: line endings)


From: Rob Mahurin
Subject: shebangs calling octave.app (was: line endings)
Date: Fri, 15 May 2009 15:10:50 -0400

On May 14, 2009, at 1:23 PM, William Miner wrote:
Part of the solution, as several people have suggested is to add the full path to the octave executable. Having said that, It still doesn’t work.

I'm using BBedit which allow me to change the line endings.

For Unix which is a line feed I get
dsl017-068-210:Octave williamminer$ ./hello
./hello: line 3: syntax error near unexpected token `"Hello, world! \n"'
./hello: line 3: `printf("Hello, world!\n");'

This is the right sort of line ending. The error looks like your script is still being sent to the shell, instead of to octave.

And finally for windows which is carriage return line feed I get
dsl017-068-210:Octave williamminer$ ./hello
-bash: ./hello: /Applications/Octave.app/Contents/Resources/bin/ octave^M:
bad interpreter: No such file or directory
dsl017-068-210:Octave williamminer$

Aha: that file in the Octave.app package is a shell script which sets some environment. Apparently shell scripts can't be shebang interpreters (which makes sense, thinking about how the kernel turns a shebang into an exec()).

If you set up your environment as in that script, you should be able to call Octave.app/.../octave-3.0.5 (or whichever version) as your interpreter. The usual way to do this is to clutter your shell startup scripts with variable definitions, which is an ugly kludge.

Cheers,
Rob

--
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee                 865 207 2594
Knoxville, TN 37996                     address@hidden






reply via email to

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