The command line Connector enables you to read the output from a command line or pipe data to a command line's standard input.
Every command argument is separated by a space character, and quotes are ignored. The command is run on the local machine.
cmd /c dir
to
list the contents of a directory.The Connector supports Iterator and AddOnly mode, as well as CallReply mode.
In Iterator and AddOnly mode, the command specified by the Command Line parameter is issued to the target system during Connector initialization, which implies it will only be issued once for the whole AssemblyLine lifetime.
However, in CallReply mode, the command is issued to the target system on each iteration of the AssemblyLine, after Output Attribute Mapping (call phase), and before Input Attribute Mapping (reply phase). In this mode, you must provide the command to be executed in an attribute called command.line; after it has executed you will find the output result in an attribute called command.output.
If a Parser is attached to the Command Line Connector, the output result will be parsed.