Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
Setting user defined parameters in shell scripts
- Job parameters Environment variables are used to make job and order parameters are accessible by environment variables to shell jobsscripts.
- There is a simple rule for the naming of environment variablesEnvironment variables are named using a predefined prefix and the name of the original parameter:
- The name of default value for the environment variable for a parameter prefix is SCHEDULER_PARAM_ NAMEOFPARAM.
- For example, the job parameter param1 is available can be accessed by the environment variable SCHEDULER_PARAM_PARAM1 .
- Environment variables are used with uppercase letters.
If you wanted not to use the prefix SCHEDULER_PARAM_ and instead use prefix is not to be used for the environment variables and instead the parameter names as environment variables then you could add themselves then the following setting can be added to your the
./config/scheduler.xml
file:Code Block language xml <params> <param name="scheduler.variable_name_prefix" value="*NONE"/> ... </param>
Hint: You have been warned, JobScheduler would overwrite Note that: there is a risk of JobScheduler overwriting already existing environment variables with new ones of the same name for the respective shellthat have been derived from job or order parameters if a prefix such as SCHEDULER_PARAM_ is not used.
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
<job> <params> <param name="param1" value="Test"/> </params> <script language="shell"> <![CDATA[ rem This is an example shell script to show the use of parameters echo Param1 has the value %SCHEDULER_PARAM_PARAM1% ]]> </script> <run_time/> </job> |
...