How to use environment variables in the addpath command?

Ernest L. Williams Jr. ernesto at slac.stanford.edu
Thu May 1 08:36:38 CDT 2008


Bill Denney wrote:
> 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
>

Eexcellent!!   That works.  :)



Thanks,
Ernesto


More information about the Help-octave mailing list