Added by Matt Casters, last edited by Jens Bleuel on Sep 21, 2011  (view change)

Labels:

shell shell Delete
script script Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Description

You can use the Shell job entry to execute a shell script on the host where the job is running.

Notes:

  • Shell scripts can output text to the console window. This output will be transferred to the Kettle logging system. Doing this no longer blocks the shell script.
  • On Windows, scripts are preceded by "CMD.EXE /C" (NT/XP/2000) or "COMMAND.COM /C" (95,98).
  • The Execute a process step is similar to this job entry but can be used in a transformation.

Options

Option Description
Job entry name The name of the job entry. This name has to be unique in a single job. A job entry can be placed several times on the canvas, however it will be the same job entry.
Insert script
Check this option when you want to execute the script in the Script tab instead of executing the Script file name. This is also useful, when you want to execute operating system commands like dir, ls or ipconfig without giving a specific path. This option creates a temporary script in the working directory and executes it.
Script file name The filename of the shell script to start, should include full path else ${user.dir} is used as path.
Working directory The directory that will be used as working directory for the shell script. The working directory only becomes active when the shell script starts so "Filename" should still include the full path to the script. When the field is left empty or the working directory is invalid ${user.dir} will be used as working directory.
Specify log file Check this if you want to specify a separate logging file for the execution of this shell script.
Name of log file The directory and base name of the log file (for example C:\logs)
Extension of the log file The filename extension (for example: log or txt)
Include date in filename? Adds the system date to the filename. (_20051231)
Include time in filename? Adds the system time to the filename. (_235959)
Loglevel Specifies the logging level for the execution of the shell. See also the logging window in .14 Logging
Copy previous results to arguments? The results from a previous transformation can be sent to the shell script using the "Copy rows to result" step. (as arguments)
Execute once for every input row This implements looping. If the previous job entry returns a set of result rows, you can have this shell script executed once for every row found. One row is passed to this script at every execution in combination with the copy previous result to arguments. The values of the corresponding result row can then be found on command line argument $1, $2, ... (%1, %2, %3, ... on Windows)
Arguments table Specify the strings to use as arguments for the shell script.