[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: source-ing files vs. entering on cmd line?
From: |
Mario Storti |
Subject: |
Re: source-ing files vs. entering on cmd line? |
Date: |
Tue, 17 Nov 1998 17:19:42 -0300 |
>>>>> On Tue, 17 Nov 1998 15:26:03 -0500 (EST),
>>>>> Daniel Friedman <address@hidden> said:
> I am running Octave version 2.0.13. Suppose I start Octave while in
> directory 'foo', and I have a file in ./bar/mstuff.m I wish to run,
> to declare a bunch of special functions at the beginning of a particular
> session. Without adding the 'bar' directory to LOADPATH, since I need
> the bar directory only once, is there a way to specify to octave where to
> look for mstuff.m just one time? If I could enter "bar/mstuff" on the
> command line, that would be great, but this of course doesn't work. Do
> I have to change to the bar directory, run mstuff, and then change back
> where I was?
> I tried source("bar/mstuff"), and this executes without error, but the
> functions defined in mstuff are not remembered by Octave for later use.
> Thanks,
> --dan
Use the following,
octave> source("./bar/mstuff.m")
>From the Octave manual:
> - Built-in Function: source (FILE)
> Parse and execute the contents of FILE. This is equivalent to
> executing commands from a script file, but without requiring the
> file to be named `FILE.m'.
Regards,
Mario
%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%
Mario Alberto Storti | Fax: (54)(42) 55.09.44 |
Centro Internacional de Metodos Computacionales| Tel: (54)(42) 55.91.75 |
en Ingenieria - CIMEC (INTEC/CONICET-UNL) |........................|
INTEC, Guemes 3450 - 3000 Santa Fe, Argentina |
Reply: address@hidden, http://venus.unl.edu.ar/gtm-eng.html |