From help-octave-request at bevo dot che dot wisc dot edu Wed Apr 1 23:16:42 1998 Subject: Re: arguments to scripts... From: "Wonkoo Kim" To: "John W. Eaton" Cc: help-octave at bevo dot che dot wisc dot edu Date: Thu, 02 Apr 98 00:05:26 -0500 > Date: Fri, 27 Mar 98 11:39:50 -0600 > From: "John W. Eaton" > 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 (wkim+ at pitt dot edu)