[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to run Octave scripts with MacOS
From: |
Stuart Edwards |
Subject: |
Re: How to run Octave scripts with MacOS |
Date: |
Thu, 6 May 2010 08:54:51 -0400 |
On May 5, 2010, at 7:18 PM, Ben Abbott wrote:
>
> On May 5, 2010, at 3:38 PM, Richard J Wittebort wrote:
>
>> Hi,
>> I have downloaded and installed octave for an intel mac (OS 10.5.8). The
>> application now resides in a directory called 'octave_all' located in the
>> applications directory and command line instructions execute as expected.
>> However, I am unable to execute, for example, the following script (test.m)
>> from the command line if the file is located in my 'octave_all' directory:
>>
>> #! applications/octave_all/octave.app/Contents/Resources/bin/octave -qf
>>
>> a=[1,2,3]
>> a
>> # end of script
>>
>> Could you please tell me how to run a script. For example, which, if any, of
>> the following is required and how to do it:
>>
>> 1. add a path in the command line?
>> 2. transfer the script to a directory in the octave.app directory?
>> 3. use a header different from the 1st line in the above (#!
>> applications/octave_all/octave.app/Contents/Resources/bin/octave -qf)
>>
>> I much appreciate your help,
>
>
> Try ...
>
> #!/usr/bin/env
> /Applications/octave_all/Octave.app/Contents/Resources/bin/octave -qf
> a=[1,2,3]
> a
> # end of script
>
> Ben
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Thank you! this solves a problem that I too have been trying to fix for a long
time without success (OS X 10.6).
Also make sure the the script is executable and you can then run it from
anywhere with ./path/to/script/test.m
Stu