help-octave
[Top][All Lists]
Advanced

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

Re: Octave advocacy


From: Mike Miller
Subject: Re: Octave advocacy
Date: Fri, 17 Sep 2004 16:14:38 -0500 (CDT)

On Fri, 17 Sep 2004, David Bateman wrote:

Why not include the line

#! /usr/local/bin/octave -q

as the first line of your script and then the script itself is execeutable


I'm not sure that I understand your point. The script I wrote (below) will run arbitrary octave commands straight from the command line. If the script began with the line you suggest, would it run arbitrary code entered on the command line, or would it only run whatever code I typed on subsequent lines within the script?

Maybe your approach will be better than mine, but we need a way to write your script such that it will read arguments from the command line and execute them as octave commands. Maybe something like 'eval' could be used, but I'm not sure it would be better than what I have.

Best,

Mike



According to Mike Miller <address@hidden> (on 09/17/04):

-------begin script on next line---------
#!/usr/local/bin/tcsh -f

echo "$1" | /usr/local/bin/octave -q
-------end script on previous line---------

I call the script "compute" and I put it in my path.  You might have to
change the paths in the script, and you have to chmod to make it
executable.

Once you have the script installed, instead of this....

echo 'sqrt(29)' | octave -q

...you can do this...

compute 'sqrt(29)'



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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