2.6.4 Converting arguments during command execution
JP1/Advanced Shell converts arguments when commands are executed; this applies to standard shell commands, extended shell commands, extended script commands, reserved script commands, functions, external commands, and user programs. You can perform this conversion between the following platforms:
Between the same platforms: UNIX
UNIX or Windows
Windows
Between different platforms: UNIX
Windows or Windows
UNIX
JP1/Advanced Shell analyzes each line of a job definition script according to the defined rules. If a character string in a specified argument exactly matches the character string in an argument of a command to be executed, the character string in the argument is converted to the specified character string. You use the COMMAND_CONV_ARG parameter to specify conversion rules.
- Organization of this subsection
(1) Example of combining the PATH_CONV and COMMAND_CONV_ARG parameters
This subsection presents an example in which the PATH_CONV and COMMAND_CONV_ARG parameters are combined in the Windows edition. If both parameters are specified, the PATH_CONV parameter takes precedence. When the same parameter is specified more than once, the parameters are processed sequentially in the order they are specified.
(a) Contents of environment file
The following example shows the contents of an environment file (with a number assigned to each line):
1. #-adsh_conf PATH_CONV_ENABLE / : 2. #-adsh_conf PATH_CONV /tmp "C:\\temp" 3. #-adsh_conf COMMAND_CONV_ARG /tmp/data.txt "C:\\jp1as_tmp\\data3.txt" 4. #-adsh_conf COMMAND_CONV_ARG "C:\temp\data.txt" "C:\\jp1as_tmp\\data4.txt" 5. #-adsh_conf PATH_CONV_RULE 1
(b) Contents of job definition script and the conversion method
If the following job definition scripts are executed on the environment file shown in (a), they produce different results.
cat "/tmp/data.txt" > ./result.log
This example specifies 1 in the PATH_CONV_RULE parameter; therefore, the range enclosed in double quotation marks (") is converted by the PATH_CONV parameter.
Because "/tmp/data.txt" specified in the cat command is enclosed in double quotation marks ("), it is converted to "C:\\temp\\data.txt" by the rule on line 2 in the environment file. Therefore, the rule on line 3 does not apply. The rule on line 4 applies; as a result, this path is further converted to "C:\\jp1as_tmp\\data4.txt".
cat /tmp/data.txt > ./result.log
Because /tmp/result.log specified in the cat command is not enclosed in double quotation marks ("), it is not subject to conversion by the PATH_CONV parameter specified on line 2. The rule on line 3 applies and the path is converted to "C:\\jp1as_tmp\\data3.txt".