help-octave
[Top][All Lists]
Advanced

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

using relative paths to execute octave scripts


From: Kamaraju S Kusumanchi
Subject: using relative paths to execute octave scripts
Date: Wed, 20 Apr 2011 22:43:40 -0400
User-agent: KNode/4.4.7

Consider the following directory structure
$tree                                                                           
                                    
.
├── a
│   └── hello_world.m
└── b

$cat a/hello_world.m                                                            
                                    
printf("Hello, world!\n");

the following works

$cd a/                                                                          
                                    
$octave -q                                                                      
                                    
octave:1> hello_world
Hello, world!
octave:2> quit

However, If I do
$cd ../b
$octave -q
octave:1> ../a/hello_world
parse error:

  syntax error

>>> ../a/hello_world
    ^

which brings my question. Is there anyway to execute octave scripts using 
relative path? If not, could this feature please be added?

Note: My current work around for this "deficiency" is to use addpath to add 
the a/ directory into the path list. However, the drawback of this approach 
is that, sometimes I have multiple versions of hello_world.m in different 
directories and I want to call different versions at different times in the 
master script.

Using octave 3.0.1 on Debian Squeeze.

thanks
-- 
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/



reply via email to

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