Rob Nicholas schrieb:
> Hello all,
> 
> I'm in the process of trying to convert some of the Octave (and
> Matlab) scripts that I use on a regular basis into stand-alone
> executables, but I've been unable to get my scripts to run.  For
> example,  if I run the simple two-line script
> 
>       #! /Applications/Octave.app/Contents/Resources/bin/octave
>       disp('hello');
> 
> from the shell (e.g. './otest'), I get
> 
>      ./otest: line 2: syntax error near unexpected token `'hello''
>      ./otest: line 2: `disp('hello');'
> 
> as output.  The script works fine, of course, from within the
> interactive environment or if I do 'octave otest' from the shell.  Can
> anyone make sense of what's going on here?  Is this a shell error
> rather than an Octave error? FYI, I'm using the most recent version of
> Octave.app (December 2007) on a new iMac running Leopard.

It's not clear to me where the problem really occurs but I somehow can see that 
Octave isn't started. I also mentioned a similiar problem if I use a shebang 
line for a /usr/bin/tclsh script - so I expect it's somehow caused by the OS 
(at 
least on my 10.4 system it looks the same as on your 10.5 system).

But the good news is that I've a workaround for you, use the following shebang 
line and then Octave starts up and should produce the output that you desire:

   #!/bin/sh /Applications/Octave.app/Contents/Resources/bin/octave --quiet
   disp ('hello');

Thomas

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to