2.6.12 Migrating job definition scripts from UNIX to Windows
This subsection explains how to migrate UNIX job definition scripts to Windows job definition scripts. Before you perform the procedure, make sure that the encoding of the job definition scripts and environment files matches the value of the LANG environment variable that is used on the target platform.
To migrate from UNIX job definition scripts to Windows job definition scripts:
-
Enable the path conversion functionality.
To convert the separators used in UNIX job definition scripts to those supported by Windows platforms, specify the following parameter in the environment file:
#-adsh_conf PATH_CONV_ENABLE / :
-
Specify the setting needed for converting the specified paths.
If program paths are specified explicitly in job definition scripts, specify the parameter shown below to convert the paths to paths used in the Windows environment. This example converts the paths of UNIX-compatible commands.
#-adsh_conf PATH_CONV /opt/jp1as " "C:\\Program Files\\HITACHI\\JP1AS\\JP1ASE"
-
Specify the setting needed for converting the separators around the shell variables that handle paths.
If program paths are specified by using shell variables in job definition scripts, add the following command for each job definition script to convert the separators in the paths using shell variables:
#-adsh_path_var VAR
-
Select the path conversion setting. (Windows only)
Specify the path conversion setting by using the PATH_CONV_RULE parameter.
If you want to convert a part enclosed in double quotation marks ("), specify path conversion setting 1 as follows:
#-adsh_conf PATH_CONV_RULE 1
If you want to convert a part that is not enclosed in double quotation marks (") as well as a part enclosed in double quotation marks, specify path conversion setting 2 as follows:
#-adsh_conf PATH_CONV_RULE 2
-
Verify that conversion is enabled.
In path conversion setting 1, verify that the paths to be converted are enclosed in double quotation marks (") as shown in the following example:
"$VAR/cmd/ls" -l "/opt/jp1as/sample"
In path conversion setting 2, verify that the path that you do not wish to convert is enclosed in single quotation marks (').
-
Check the path conversion results.
Perform a syntax check on the job definition script (adshexec -c command) and check the path conversion results in the generated script image. If the conversion results are not correct, either change the path conversion setting or edit the job definition script, and then perform a syntax check again.
The following shows examples of path conversion settings 1 and 2.
-
Example of conversion using path conversion setting 1
Environment setting parameters:
#-adsh_conf PATH_CONV_ENABLE / : #-adsh_conf PATH_CONV_RULE 1 #-adsh_conf PATH_CONV /opt/jp1as " "c:\\Program Files\\HITACHI\\JP1AS\\JP1ASE"
Example of conversion:
D:\home\user001>"C:\Program Files\Hitachi\JP1AS\JP1ASE\bin\adshexec.exe" -c sample1.ash ***** D:\home\user001\sample1.ash ***** 0001 : #-adsh_job SAMPLE 0002 : #-adsh_path_var VAR 0003 : 0004 : VAR=/opt/jp1as 0005 : "$VAR/cmd/ls" -l "/opt/jp1as/sample" 0006 : ***** Converted lines in "C:\home\user001\sample1.ash" ***** 0005 : "$VAR\\cmd\\ls" -l "c:\\Program Files\\HITACHI\\JP1AS\\JP1ASE\\sample" KNAX7999-I Advanced Shell ended. exit status=0 D:\home\user001>
-
Example of conversion using path conversion setting 2
Environment setting parameters:
#-adsh_conf PATH_CONV_ENABLE / : #-adsh_conf PATH_CONV_RULE 2 #-adsh_conf PATH_CONV /opt/jp1as " "c:\\Program Files\\HITACHI\\JP1AS\\JP1ASE"
Example of conversion:
D:\home\user001>"C:\Program Files\Hitachi\JP1AS\JP1ASE\bin\adshexec.exe" -c sample1.ash ***** D:\home\user001\sample1.ash ***** 0001 : #-adsh_job SAMPLE 0002 : #-adsh_path_var VAR 0003 : 0004 : VAR=/opt/jp1as 0005 : "$VAR/cmd/ls" -l "/opt/jp1as/sample" 0006 : ***** Converted lines in "D:\home\user001\sample1.ash" ***** 0004 : VAR="c:\\Program Files\\HITACHI\\JP1AS\\JP1ASE" 0005 : "$VAR\\cmd\\ls" -l "c:\\Program Files\\HITACHI\\JP1AS\\JP1ASE\\sample" KNAX7999-I Advanced Shell ended. exit status=0 D:\home\user001>