ksc_local_exec

This command invokes a local process on the machine running the PPM Server. It can be used to run any program that does not require interactive input. Each call using ksc_local_exec is an independent process. It does not execute in the context of other commands that precede it. The starting directory for the processes generated using ksc_local_exec is the home directory of the PPM Server. Full paths to the executable being called are necessary if the PPM Server does not have the correct system path information.

Note: The ksc_local_exec command does not open a TELNET, SSH or SSH2 connection to the PPM Server. It operates by creating a new child process on the machine that is running the PPM Server. Therefore, the user account and password for this process will be the same as the account and password used to start the PPM Server.

Example using ksc_local_exec

# Rename existing file ‘file.txt’ to ‘newfile.txt’
ksc_local_exec mv file.txt newfile.txt
# Run a DOS batch file
ksc_local_exec cmd /c runme.bat

System commands do not invoke either Unix shells or DOS shells. This means that the following code segment using ksc_local_exec is not valid, because it cannot use the ‘pipe’ (|) or redirect commands (>):

ksc_local_exec cat names.txt | grep address > file.out

An effective way to use the ksc_local_exec command is to put a series of commands into a .sh file, and then execute the .sh file as shown:

ksc_begin_script + [AS.CR_TRANSFER_PATH] run.sh
..
<series of commands>
ksc_end_script
ksc_local_exe ksh run.sh