[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: a=which('myfile')

**From**: |
viveks |

**Subject**: |
Re: a=which('myfile') |

**Date**: |
Fri, 4 Aug 2000 00:28:55 +0530 (IST) |

On Thu, 3 Aug 2000, Daniel Heiserer wrote:
>* is there a way to obtain the output of *
>* "which"?*
>* *
>* myfile_=which('myfile');*
>* *
>* Then I can check the path in which myfile is.*
I tried it with system as given below.
octave:355> xxxx = system("which octave")
xxxx = /usr/bin/octave
However, this would work with files in the system path (executable
programs).
One more example below:
octave:356> xxxx = system("which ls")
xxxx = /bin/ls
Otherwise, "which" function of octave works the other way:
octave:363> help which
which is a builtin text-function
which NAME ...
display the type of each NAME. If NAME is defined from an function
file, print the full name of the file.
octave:364> which("tmp")
which: `tmp' is the script file: /home/viveks/2k/july2k/27/tmp.m
octave:365> which("K")
K is a user-defined variable
If this does not answer your question, perhaps I haven't understood the
problem. Or, I don't know the answer.
Vivek...
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------