Kbase 19179: How to get the process id (PID) from within 4GL in UNIX
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  06/10/1999 |
|
How to get the process id (PID) from within 4GL in UNIX
the process id in unix is stored in $$. If you type "echo $$" at the unix prompt it would display the process id.
OS-GETENV does not return all of the system environment variables' values. (i.e. "os-getenv $$" would not work.)
Here is a way to get the process id from within 4GL. It requires a unix shell script and a 4GL procedure.
This is only for debugging purposes as it returns the PID of the last instance of _progres
# getpid.scr
ps | sort | grep "_progres" | tail -1 | while read line
do
set $line
echo $1
done
/* Getpid.p */
def var v-pid as int.
input thru getpid.scr.
import v-pid.
Input close.
Display v-pid.