Command Syntax
The command syntax depends on whether the Data Integration Service runs on UNIX or Windows.
When the Data Integration Service runs on UNIX, you can use any valid UNIX command or shell script. The service runs the following command during the workflow where <command> is the command that you enter in the Command task:
/bin/sh -c "<command>"
When the Data Integration Service runs on Windows, you can use any valid DOS or batch file. The service runs the following command during the workflow where <command> is the command that you enter in the Command task:
cmd.exe /c "<command>"
For example, you might use a shell command to copy a file from one directory to another. For Windows, enter the following shell command to copy the SALES_ ADJ file from the source directory, L, to the target, H:
copy L:\sales\sales_adj H:\marketing\
For UNIX, enter the following command to perform a similar operation:
cp sales/sales_adj marketing/
Use the following rules and guidelines when you enter a command:
- •The command cannot contain a carriage return character or line feed character.
- •To run an external executable program from the command, enter the fully qualified path to the program. For example, to run a custom application named myCustomApp.exe, use the following command:
c:\myCustomApp.exe
When you run an external program from the Command task, the task remains in a running state until the program closes.
- •Each Command task runs in the same environment as the Data Integration Service. To change the environment settings, create a script or batch file that changes the settings and includes the command to run. Then use the following command to run the file:
c:\mybatfile.bat
Parameters and Variables in a Command
You can include workflow parameters and variables in a command.
You can select a workflow parameter or variable from Inputs tab in the Command tab, or you can type the parameter or variable name in the command using the required syntax.
For example, the following command uses a workflow parameter named SourceDirectory to define the source directory from which the command copies a file:
copy ${par:SourceDirectory} H:\marketing\