[Top][All Lists]

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

Re: detecting .m file name

From: Wonkoo Kim
Subject: Re: detecting .m file name
Date: Tue, 23 Jun 98 02:35:10 -0400

> Date: Mon, 22 Jun 98 23:53:18 -0500
> From: "John W. Eaton" <address@hidden>
> Subject: detecting .m file name
> On 21-Jun-1998, Wonkoo Kim <address@hidden> wrote:
> | I'm using Octave 2.0.13 for OS/2.
> |
> | Can I know .m file name when it is running?  (like program_name)
> | I want to detect which .m file is running, for a batch job.
> It's not clear to me exactly what you want.  Can you give an example?

Oh, sorry.  

Suppose "foo.m" has a line:

  eval(sprintf("gset output \"\"", this_script_name));

and I want the above line does

  gset output ""  (or, gset output "")

when I run it from Octave.

> If it is to get the name of a script file while it is running,
> program_name gives you that provided that you are running it with
>   octave script.m
> or
>   ./script.m
> (by using the `#!' hack on Unixy systems and making the file script.m
> executable).

If I put 'program_name' in foo.m, I got

program_name = octave.exe

but I want "foo" or "foo.m".


// Wonkoo Kim (address@hidden)

reply via email to

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