Shell nodes support standard shell syntax but not interactive syntax.
A Shell node that is run on an exclusive resource group for scheduling may need to access a data source that has a whitelist. In this case, you must add the information about the resource group to the whitelist of the data source. For more information, see Add the exclusive resource group for scheduling to the whitelist of the data store to be accessed.
- Go to the DataStudio page.
- Log on to the DataWorks console.
- In the left-side navigation pane, click Workspaces.
- In the top navigation bar, select the region where the required workspace resides, find the workspace, and then click Data Analytics.
- On the Scheduled Workflow tab, move the pointer over the icon and choose . Alternatively, you can click a workflow in the Business Flow section, right-click General, and then choose .
- In the Create Node dialog box, set the Node Name and Location parameters.Note The node name must be 1 to 128 characters in length and can contain letters, digits, underscores (_), and periods (.).
- Click Commit.
- Configure the Shell node.
- Write the code of the Shell node in the code editor. To use the system scheduling parameters in the Shell node, execute the following statement:
echo "$1 $2 $3"Note Separate multiple parameters with spaces. Example: Parameter1 Parameter 2. For more information about the system scheduling parameters, see Configure scheduling parameters.
- Click the icon in the top toolbar to save the SQL statements.
- Click the icon in the toolbar to execute the SQL statements that you have saved. If you want to use another resource group to test the Shell node on the DataStudio page, click the icon in the toolbar and select the exclusive resource group to use.
- Write the code of the Shell node in the code editor.
- On the node configuration tab, click the Properties tab in the right-side navigation pane. On the Properties tab, set the scheduling properties for the node. For more information, see Configure basic properties.
- Save and commit the node.Notice You must set the Rerun and Parent Nodes parameters before you can commit the node.
In a workspace in standard mode, you must click Deploy in the upper-right corner after you commit the node. For more information, see Deploy nodes.
- Click the icon in the toolbar to save the node.
- Click the icon in the toolbar.
- In the Commit Node dialog box, enter your comments in the Change description field.
- Click OK.
- Test the node. For more information, see View auto triggered nodes.