9.5.5 #-adsh_path_var command (defines shell variables for handling path names)
Syntax
#-adsh_path_var shell-variable-name[, ... shell-variable-name]
Description
This command defines shell variables for handling path names. This command is enabled when the PATH_CONV_ENABLE parameter is defined in the environment file.
This specification is prioritized over the specification of the PATH_CONV_VAR parameter and PATH_CONV_NOVAR parameter of environment file.
The #-adsh_path_var command can be specified at the following locations only:
The line after #!any-character-string on the first line
The line after the #-adsh_job command
The first line (continuation lines are allowed).
When a shell variable specified by this command is described at the beginning of a path name, the path and directory separators in that path name as defined by the PATH_CONV_ENABLE parameter are converted to the path and directory separators of the target OS.
A text whose leading part matches the shell variable specified in either of the following formats is treated as a path name:
$shell-variable-name
${shell-variable-name}
Variable names must match completely. If shell-variable-name has a suffix consisting of a letter or the underscore (_), it will be evaluated as not to be a targeted shell variable and will not be converted.
After conversion, if the character string to be converted contains a path separator or directory separator defined by the PATH_CONV_ENABLE parameter, that separator is converted according to the OS under which the job definition script will be executed.
The conversion result depends on whether path conversion rule 1 or path conversion rule 2 was set by the PATH_CONV_RULE parameter. For details about the path conversion rules, see 7.3.34 PATH_CONV_RULE parameter (defines a rule for converting file paths) (Windows only). For conversion examples of job definition scripts, see 2.6.2 Converting path names.
Arguments
- shell-variable-name
~<environment variable name>((1 to 255 bytes))
Specifies the name of an environment variable that is to be used to define a shell variable for handling path names. A maximum of 255 shell variables can be specified. To use the defined shell variable in a job definition script, is must be specified as $shell-variable-name or ${shell-variable-name}.
For details about pre-defined shell variables and shell variable names that cannot be used, see 5.5 Shell variables.
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
1 |
Error termination |
Notes
The conversions specified by this command are performed on a line-by-line basis. For this reason, if there is a linefeed in a job definition script, the path name might not be converted correctly.
In the following example, $DIR1linefeed-code\\bar1\\... is specified in the job definition script, to be converted based on path conversion rule 1 in Linux:
#-adsh_path_var DIR1,DIR2 echo foo > "$DIR1 Not converted because linefeed is entered within "". \\bar1\\"$DIR2\\bar2"bar3" $DIR2\\bar2 is converted to $DIR2/bar2.
In the following example, $DIR1linefeed-code/bar1/... is specified in the job definition script, to be converted based on path conversion rule 2 in Windows:
#-adsh_path_var DIR1,DIR2 echo foo > '$DIR1 /bar1/"$DIR2/bar2"bar3' $DIR2/bar2 is converted to $DIR2\\bar2.
Character strings with comments are also subject to conversion.
If DELETE is specified for the SPOOLJOB_CHILDJOB parameter, no script images are output in the case of job definition scripts executed as child jobs. For this reason, if a job definition script executed as a child job is converted based on a conversion rule defined by this command, the conversion results will not be output.
-
The variable that is specified by the #-adsh_path_var command is not defined as the variable handling the path in the different process. If you define the variable handling the path in the different process, specify the variable by using the PATH_CONV_VAR parameter and the PATH_CONV_NOVAR parameter. [Only for Windows]