help-octave
[Top][All Lists]
Advanced

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

Re: loading a function from the same dir as script.oct


From: Michael Goffioul
Subject: Re: loading a function from the same dir as script.oct
Date: Mon, 10 Sep 2007 22:14:31 +0200

On 9/10/07, address@hidden <address@hidden> wrote:
> Hi friends,
> i realized that a function, say, func.m will be automaticaly
> found if it is on the same dir as I am when calling octave.
> But if I do
>     octave ~/scripts/myscript.oct
> and myscript.oct calles func.m, which is in ~/scripts/func.m
> then func will not be found. How can I make myscript.oct
> search for function definitions in its directory, whithout
> having to set an absolute path inside the script.
> This is useful since i want to make the script
> executable in different machines.
> Thanks a lot for your attention ...
>
> PS: things like addpath(pwd) do not work because
> pwd will be where i am in the shell, and not where
> myscript.oct is.

Can't you use the "--path" option of octave?
On my system, if I do a "octave --path C:\Temp -qf --eval path", then I
see C:\Temp prepended to normal octave paths.

Michael.


reply via email to

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