How to use environment variables in the addpath command?

Bill Denney bill at denney.ws
Thu May 1 05:37:17 CDT 2008


Ernest L. Williams Jr. wrote:
> How does one achieve the following in octave 3.0.1?
>
>
> addpath("$MY_VAR/lib/$HELLO_WORLD")
>
> I get the following error:
> warning: addpath: $MY_VAR/lib/$HELLO_WORLD: No such file or directory
>   
You want to do something like

addpath ([getenv("MY_VAR") "/lib/" getenv("HELLO_WORLD")])

Have a good day,

Bill


More information about the Help-octave mailing list