Cameron Huddlestone-Holmes:
|Is it possible to pass variables to a dx script when running in script mode?
|
|i.e. dx -script <scriptname> [var1, var2]
|
|Where var1 and var2 might be values for IsoSurface for instance.
|
|I have a task I want to do multiple times on the same dataset with different
|values that can't be sequenced. Writing a C program with DXLink seems like
|overkill (particularly when I don't know C!).
You can do this:
dx -script script_macros.scr -scriptcmd "MyMacro($value1,$value2)"
or
dx -scriptcmd "data = Import($value1); Print(data);"
and use standard shell scripting variables in place of the variables in
scriptcmd.
The above is shorthand for doing things like this:
dx -script << EOF
include "script_macros.scr"
MyMacro( param1 = $value1, param2 = $value2, ... );
EOF
And of course, all of your favorite shell's rules for expanding shell
variables and protecting shell metacharacters apply. E.g.:
dx -script ScriptCmd.net -scriptcmd "ScriptCmd($naam,$numb)"
dx -script ScriptCmd.net -scriptcmd 'ScriptCmd('$naam','$numb')'
dx -script ScriptCmd.net -scriptcmd ScriptCmd\($naam,$numb\)
Randall
--
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA N127-01; RTP, NC 27711