How to get process id (PID) from gSystem->Exec(command)?

Hello! :slight_smile:

Please help me with a simple question:

I need to get process id (PID) from gSystem->Exec(command) of
the “command”. I just would like to kill it at the end of the current
program work :wink:

Thanks a lot!!!

Sergei.

Use gSystem->GetPid()

Rene

Dear Rene,

This is not what I want.

gSystem->GetPid() gives the PID of the current process but
not the PID of the process started by gSystem->Exec(command).

Example:

gSystem->Exec(“ls ~”);

The goal is to find the PID of this “ls” command.

Sergei.

Hello Sergej, try pgrep or pidof.
Cheers,
Oliver