Parameterized Environments
An environment definition may accept parameters. This is useful, for example, to select different versions of some tool.
Parameters are passed to the script either one of syntaxes shown below. The older syntax uses parentheses, which need quoting when used from the shell
environmentName(parameter1[,parameter2]...)
environmentName,parameter1[,parameter2]
The parameters are a comma-separated list of tokens that are placed in parentheses after the environment name or after the first comma. No spaces are allowed. Arguments cannot contain commas, spaces, quotes, or other special characters. Proper quoting must be used when switching to a parameterized environment from the command line.
Examples
% ves '+D(DISPLAY=tahoe:0.0)'
% ves '+D,DISPLAY=tahoe:0.0'
% ves '+SYNOPSYS(1998.08)'
% ves '+SYNOPSYS,1998.08'
From inside the environment script, the parameters are accessible by means of the
variable '$argv' in C-shell or the list $argv
in Tcl. Parameters
are passed to both the start.tcl script, and the
end.tcl script.
D
:
# This is D.start.tcl
# An environment to define variables.
# Usage: ves +D,VAR1=value,VAR2=value,...
foreach arg $argv {
if [regexp {([^=]+)=(.*)} $arg all var value] {
setenv $var $value
lappend env(D_env_vars) $var
}
}
D
using parentheses, like this:
% nc run -e "D(VOV_LIMIT_maxproc=8192,VOV_LIMIT_openfiles=8192)" env
% nc run -e D,VOV_LIMIT_maxproc=8192,VOV_LIMIT_openfiles=8192 env
set VOV_JOB_DESC(env) "SNAPSHOT+D,VOV_LIMIT_maxproc=8192,VOV_LIMIT_openfiles=8192"
nc run -e 'D(FOO={value,with,commas},BAR=normal_value)' ...
and
ves 'D(FOO={bar,baz})'
set VOV_JOB_DESC(env) "SNAPSHOT+D,VOV_LIMIT_maxproc=8192,MY_CSV_VAR={a,b,c},VOV_LIMIT_openfiles=8192"