Execution Tokens

The prefix for these tokens is EXEC.

Table A-15. Execution (EXEC) tokens

Prefix

Tokens

Description

EXEC

EXIT_CODE

Exit code of a command execution.

EXEC

OUTPUT

Last line of output from a command execution.

You can use the command execution tokens, [EXEC.OUTPUT] and [EXEC.EXIT_CODE]in the following contexts:

  • Inside command step segments that use the ksc_connect and ksc_exit special commands.

  • Immediately after command step segments that use the ksc_local_exec special command.

For example, the following code segment demonstrates how to use both of these command execution tokens to retrieve the output and exit code immediately upon execution. The tokens are used immediately after the ksc_local_exec special command.

ksc_local_exec pwd
ksc_set MY_PATH="[EXEC.OUTPUT]"
ksc_set MY_EXIT_CODE="[EXEC.EXIT_CODE]"
ksc_local_exec echo '[MY_PATH]/bin'
ksc_local_exec echo '[MY_EXIT_CODE]'