help-octave
[Top][All Lists]
Advanced

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

Re: arguments to scripts...


From: Wonkoo Kim
Subject: Re: arguments to scripts...
Date: Thu, 02 Apr 98 00:05:26 -0500

> Date: Fri, 27 Mar 98 11:39:50 -0600
> From: "John W. Eaton" <address@hidden>
> Subject: arguments to scripts...
>
> With the current release, if you make an executable program out of
> your script using the `#! /path/to/octave' hack available on most Unix
> systems, you can do something like this
>
>   #! /path/to/octave -qf
>   printf ("%s", program_name);
>   for i = 1:nargin
>     printf (" %s", argv(i,:));
>   endfor
>   printf ("\n");
>
> and
>
>   ./program-name foo bar etc
>
> will reproduce the command line on the standard output.
>
> If you want to call your script from the Octave command line, you can
> either use variables in the workspace (variables in script files are
> share the same scope with the calling procedure) or you can convert
> your script to a function and pass arguments to it in the normal way
> for calling functions.
>
> jwe

It's good to know that this also works with OS/2 .cmd script.
(replace the 1st line to:  extproc octave -qf).

Thank you.

//--------------------------------------------------------------------
// Wonkoo Kim (address@hidden)



reply via email to

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