Command : Exec,Run,Writeproc,Killproc,Proclist


Syntax


EXEC < commandline >
RUN < commandline >
KILLPROC ( all | < process-pid > )
WRITEPROC < process-pid > < text-to-write >
PROCLIST

Description


These functions will start|stop|or communicate with child processes.
RUN : Starts an EXTERNAL process. Once started the process lives its own life.
EXEC : Starts a CHILD process. The process runs 'with' KVIrc, and it will be terminated when KVIrc exits. If the process outputs something to stdout or stderr, you will see it like in a shell. It's also possible to write to stdin of this process.
KILLPROC : Kills a proces with a specified process id, or all processes if 'all' is specified instead of a pid.
WRITEPROC : Writes to a process with the specified pid. A < LF > character is appended to the input buffer.
PROCLIST : Lists all running child processes.

Example


/RUN kedit /root/README
/EXEC /bin/bash
Here is a short example of use of all these functions with the output that may be generated:
/EXEC telnet localhost
# Starting process 'telnet localhost' with pid 7999
# [stdout 7999] : Trying 127.0.0.1...
# [stdout 7999] : Connected to localhost,escape character is....
# [stdout 7999] : Login :
/WRITEPROC 7999 root
# [stdin 7999] : root
# [stdout 7999] : Password :
/WRITEPROC 7999 mypassword
# [stdin 7999] : mypassword
# [stdout 7999] : Last login on tty401 on 12.4.2007 ...
# [stdout 7999] : [root@localhost root]
/PROCLIST
# Pid :7999 Commandline :telnet localhost
/KILLPROC 7999
# Process 7999 Killed.

See also



Index  Command list  Commandline syntax