Custom:executeForString

Method

Purpose

This method (on all platforms) executes a command and returns the output as a string.

Remarks

The command that is executed can return information by sending strings to stdout. If the executed command returns more than one line, the lines are concatenated to produce one string.

When using this method on the OS/400 platform, only commands that start with system (when using a CL command) and qsh (when using Q shell utilities) are supported. Use the -c option when using the qsh command.

Examples,

qsh -c ls
system DSPDTAARA DTAARA (<LibName>/<Data Area Name>)

Type

Synchronous, IMPACT_ACTION_INFO.

Arguments

 

Name

Type

Description

command

String

The command to execute. Should be exactly as would be read on the command line. External and internal variables can be used in the command string.

Returns

 

Name

Type

Description

returnString

String

The String representation of the command’s output