Example 3: Execute Native Command using Variables and Arguments on Unix
Example 3: Execute Native Command using Variables and Arguments on Unix
In this example, a variable will be used to store a directory location. When the Unix 'ls' command is executed, Arguments will pass in a command parameter as well as the directory location variable to the command.
From within the Project Designer page, right click on the Project module and select
Add a Variable
.
On the Basic tab of the variable element, specify the following fields:
Variable Name
Specify a name for this variable. The name must start with a letter (a-z or A-Z), and may only contain letters, digits (0-9), underscores(_) and periods(.).
Value
Specify the initial value for this variable.
From within the Project Designer page, navigate to the
Application
Native Calls
folder in the Component Library, and then drag the Execute Native Command task to the Project Outline.
On the Basic tab of the Execute Native Command Task, specify the Executable value:
Executable
Specify the command to execute.
Click the
Add
button and select the Add Argument menu item.
On the Basic tab of the Add Arguments element, specify a value for the argument. The value can be string text or an
Expression.
Click the
Add
button and select the Add Same menu item to add another Argument.
On the Basic tab of the Add Arguments element, specify the variable created in Step 2 above.
Click the
Save
button when finished. When the Project is executed,
Managed File Transfer
will execute the "ls -l /home/linoma" command on the Unix operating system where it is installed.