Shell Script
Shell Script
Use the Shell Script task to define and execute a set of system commands.
Field | Required | Property | Description |
---|---|---|---|
Name | Yes | The name of the task | |
Directory | No | The working directory to run the command from. The default value is ${project.path} | |
Shell | Yes | The location of the shell to execute this script. On Unix, this will typically be /bin/sh | |
Script | Yes | Enter the commands for the script. When the task is executed, this will be written as tmp file and executed using the shell defined in the Shell field | |
Enabled | Yes | Enable/Disable the task | |
On Error | Yes | What to do if an error is detected |
The shell task is an extension of the Exec task that includes the ability to write the script to execute. The shell to use needs to be specified. The following table contains examples that have been tested.
OS | Shell | Comments |
---|---|---|
Unix | /bin/sh | This is pretty common for most all Unix variants. |
Windows | cmd /C call | On windows, the temp file will have the .bat extension added to it. |
Cygwin | c:/cygwin/bin/bash | |
Ant | ant -f | Yes, you can even paste a simple ant build file if so desired. On windows, use ant.bat. In fact, most script interpreters that take script files as a parameter will work this way. |