| # Add Shell Command to Job (ttaad5205m000) Use this session to add a shell command (script) to a job. In this way you can manipulate the job’s execution. You can also link a command file (cmd file), or a Visual Basic script. Related topics To add a session to a job To add a shell command to a job Shell script The command or script that you can add to a job. See these examples:
Type | Example
shell command | /usr/local/bin/transfer_files
CMD file | C:\Program Files\Own\bin\DemandJobMail.cmd
Visual Basic script | /c C:\Program Files\Own\bin\DemandJobMail.vbs
Script Arguments The parameters or arguments for the command or script, such as input file, log file, or mode. The required parameters depend on the command or script. To find out which parameters you must specify, read the code of the command file or script. See this example:
Shell script | /usr/local/bin/check_directory
Script Arguments | -n ${BSE}/tmp
Return value "successful" This field is used to determine whether the command or script is executed successfully. Specify the return value that is generated if the command or script is executed successfully. If the command or script returns the value specified in this field, the job process continues. If the command or script returns a different value, the job process terminates. Note Most commands or scripts return a 0 return value upon successful completion. However, there are several exceptions. To find out which return value you must specify, read the code of the command or script. The return value is also known under these names: Return code Error code Error level Exit status Exit code For example, the script /usr/local/bin/transfer_files returns a 0 upon successful completion. If the script fails, it returns a 1. Therefore you specify this information:
Shell script | /usr/local/bin/transfer_files
Return value "successful" | 0
Test script Executes the command or script with the specified arguments. If the execution fails, an error message is displayed. You must redirect the output of the command or script to a file or printer. See Output redirection. |